本文整理匯總了PHP中TribeEvents::removeNotice方法的典型用法代碼示例。如果您正苦於以下問題:PHP TribeEvents::removeNotice方法的具體用法?PHP TribeEvents::removeNotice怎麽用?PHP TribeEvents::removeNotice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TribeEvents
的用法示例。
在下文中一共展示了TribeEvents::removeNotice方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: tribe_include_view_list
/**
* Accepts an array of query arguments, retrieves them, and returns the html for those events in list view
*
* Optional inline example:
* < code >
* <?php
* echo myfunction();
* ?>
* </ code >
*
* @param array $args Args to be passed to TribeEventsQuery::getEvents()
* @param bool $initialize Whether the list view template class needs to be included and initialized
*
* @return string
**/
function tribe_include_view_list($args = null, $initialize = true)
{
global $wp_query;
// hijack the main query to load the events via provided $args
if (!is_null($args) || !($wp_query->tribe_is_event || $wp_query->tribe_is_event_category)) {
$reset_q = $wp_query;
$wp_query = TribeEventsQuery::getEvents($args, true);
}
// single-event notices are jumping in on this init when loading as a module
TribeEvents::removeNotice('event-past');
// get the list view template
ob_start();
if ($initialize) {
tribe_initialize_view('Tribe_Events_List_Template');
}
tribe_get_view('list/content');
$list_view_html = ob_get_clean();
// fix the error of our ways
if (!empty($reset_q)) {
$wp_query = $reset_q;
}
// return the parsed template
return $list_view_html;
}