本文整理汇总了PHP中Tribe__Events__Main::removeNotice方法的典型用法代码示例。如果您正苦于以下问题:PHP Tribe__Events__Main::removeNotice方法的具体用法?PHP Tribe__Events__Main::removeNotice怎么用?PHP Tribe__Events__Main::removeNotice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tribe__Events__Main
的用法示例。
在下文中一共展示了Tribe__Events__Main::removeNotice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tribe_include_view_list
/**
* Include the List view
*
* 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 >
*
* @category Events
*
* @param array $args Args to be passed to Tribe__Events__Query::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 = Tribe__Events__Query::getEvents($args, true);
}
// single-event notices are jumping in on this init when loading as a module
Tribe__Events__Main::removeNotice('event-past');
// get the list view template
ob_start();
if ($initialize) {
tribe_initialize_view('Tribe__Events__Template__List');
}
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;
}