本文整理汇总了PHP中Tribe__Events__Main::defaults方法的典型用法代码示例。如果您正苦于以下问题:PHP Tribe__Events__Main::defaults方法的具体用法?PHP Tribe__Events__Main::defaults怎么用?PHP Tribe__Events__Main::defaults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tribe__Events__Main
的用法示例。
在下文中一共展示了Tribe__Events__Main::defaults方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_dropdowns
/**
* displays the saved organizer dropdown in the event metabox
* Used to be a PRO only feature, but as of 3.0, it is part of Core.
*
*/
public function render_dropdowns()
{
$post_id = $this->event->ID;
$current_organizers = get_post_meta($post_id, '_EventOrganizerID', false);
if ($this->use_default_organizer($current_organizers)) {
$current_organizers = array($this->tribe->defaults()->organizer_id());
}
$current_organizers = (array) apply_filters('tribe_display_event_organizer_dropdown_id', $current_organizers);
/* if the user can't create organizers, then remove any empty values
from the $current_organizers array. This prevents the automatic
selection of an organizer every time the event is edited. */
$organizer_pto = get_post_type_object(Tribe__Events__Main::ORGANIZER_POST_TYPE);
if (!current_user_can($organizer_pto->cap->create_posts)) {
$current_organizers = array_filter($current_organizers);
}
?>
<script type="text/template" id="tmpl-tribe-select-organizer"><?php
$this->single_organizer_dropdown(0);
?>
</script><?php
foreach ($current_organizers as $organizer_id) {
echo '<tbody>';
$this->single_organizer_dropdown($organizer_id);
echo '</tbody>';
}
}
示例2: render_dropdowns
/**
* displays the saved organizer dropdown in the event metabox
* Used to be a PRO only feature, but as of 3.0, it is part of Core.
*
* @return void
*/
public function render_dropdowns()
{
$postId = $this->event->ID;
$current_organizers = get_post_meta($postId, '_EventOrganizerID', false);
if ($this->use_default_organizer($current_organizers)) {
$current_organizers = array($this->tribe->defaults()->organizer_id());
}
$current_organizers = (array) apply_filters('tribe_display_event_organizer_dropdown_id', $current_organizers);
?>
<script type="text/template" id="tmpl-tribe-select-organizer"><?php
$this->single_organizer_dropdown(0);
?>
</script><?php
foreach ($current_organizers as $organizer_id) {
echo '<tbody>';
$this->single_organizer_dropdown($organizer_id);
echo '</tbody>';
}
}