开发者

PHP true or false

I am trying to modify a plugin called the "events calendar" for wordpress, to show past events.

I have found this function:

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

Iow can I default this to 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;
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜