当前位置: 首页>>代码示例>>PHP>>正文


PHP Tribe__Events__Main::defaults方法代码示例

本文整理汇总了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>';
        }
    }
开发者ID:lizbur10,项目名称:js_finalproject,代码行数:31,代码来源:Organizer_Chooser_Meta_Box.php

示例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>';
        }
    }
开发者ID:NallelyFlores89,项目名称:cronica-ambiental,代码行数:25,代码来源:Organizer_Chooser_Meta_Box.php


注:本文中的Tribe__Events__Main::defaults方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。