簡體   English   中英

PHP 真或假

[英]PHP true or false

我正在嘗試為 wordpress 修改一個名為“事件日歷”的插件,以顯示過去的事件。

我發現了這個 function:

/**
 * Returns true if the query is set for past events, false otherwise
 * 
 * @return bool
 */
function events_displaying_past() {
    global $spEvents;
    return ($spEvents->displaying == "past") ? true : false;
}

我可以將其默認為 true 嗎?

/**
     * Returns true if the query is set for past events, false otherwise
     * 
     * @return bool
     */
    function events_displaying_past() {
        global $spEvents;
        return ($spEvents->displaying == "past" || !isset($spEvents->displaying)) ? true : false;
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM