• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP tribe_get_option函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中tribe_get_option函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_get_option函数的具体用法?PHP tribe_get_option怎么用?PHP tribe_get_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了tribe_get_option函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: setup_where_clause

 protected function setup_where_clause()
 {
     /** @var wpdb $wpdb */
     global $wpdb;
     $clauses = array();
     $values = array_map('intval', $this->currentValue);
     $values = implode(',', $values);
     $eod_cutoff = tribe_get_option('multiDayCutoff', '00:00');
     if ($eod_cutoff != '00:00') {
         $eod_time_difference = Tribe__Date_Utils::time_between('1/1/2014 00:00:00', "1/1/2014 {$eod_cutoff}:00");
         $start_date = "DATE_SUB({$wpdb->postmeta}.meta_value, INTERVAL {$eod_time_difference} SECOND)";
         $end_date = "DATE_SUB(tribe_event_end_date.meta_value, INTERVAL {$eod_time_difference} SECOND)";
     } else {
         $start_date = "{$wpdb->postmeta}.meta_value";
         $end_date = 'tribe_event_end_date.meta_value';
     }
     $clauses[] = "(DAYOFWEEK({$start_date}) IN ({$values}))";
     // is it on at least 7 days (first day is 0)
     $clauses[] = "(DATEDIFF({$end_date}, {$start_date}) >=6)";
     // determine if the start of the nearest matching day is between the start and end dates
     $distance_to_day = array();
     foreach ($this->currentValue as $day_of_week_index) {
         $day_of_week_index = (int) $day_of_week_index;
         $distance_to_day[] = "MOD( 7 + {$day_of_week_index} - DAYOFWEEK({$start_date}), 7 )";
     }
     if (count($distance_to_day) > 1) {
         $distance_to_next_matching_day = 'LEAST(' . implode(',', $distance_to_day) . ')';
     } else {
         $distance_to_next_matching_day = reset($distance_to_day);
     }
     $clauses[] = "(DATE(DATE_ADD({$start_date}, INTERVAL {$distance_to_next_matching_day} DAY)) < {$end_date})";
     $this->whereClause = ' AND (' . implode(' OR ', $clauses) . ')';
 }
开发者ID:jamestrevorlees,项目名称:odd-web-v1.00,代码行数:33,代码来源:Day_Of_Week.php


示例2: render

 public function render()
 {
     $aggregator = Tribe__Events__Aggregator::instance();
     $event_id = get_the_ID();
     $record = Tribe__Events__Aggregator__Records::instance()->get_by_event_id($event_id);
     $last_import = null;
     $source = null;
     $origin = null;
     if (is_wp_error($record)) {
         $last_import = get_post_meta($event_id, Tribe__Events__Aggregator__Event::$updated_key, true);
         $source = get_post_meta($event_id, Tribe__Events__Aggregator__Event::$source_key, true);
         $origin = get_post_meta($event_id, Tribe__Events__Aggregator__Event::$origin_key, true);
     } else {
         $last_import = $record->post->post_modified;
         $source_info = $record->get_source_info();
         $source = $source_info['title'];
         $origin = $record->origin;
     }
     $origin = $aggregator->api('origins')->get_name($origin);
     $datepicker_format = Tribe__Date_Utils::datepicker_formats(tribe_get_option('datepickerFormat'));
     $last_import = $last_import ? tribe_format_date($last_import, true, $datepicker_format . ' h:i a') : null;
     $settings_link = Tribe__Settings::instance()->get_url(array('tab' => 'imports'));
     $import_setting = tribe_get_option('tribe_aggregator_default_update_authority', Tribe__Events__Aggregator__Settings::$default_update_authority);
     include Tribe__Events__Main::instance()->plugin_path . 'src/admin-views/aggregator/meta-box.php';
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:25,代码来源:Meta_Box.php


示例3: disabled_bar_after

 /**
  * Returns the closing tag of the disabled bar wrapper
  *
  * @return array The new body class array
  */
 public function disabled_bar_after($after)
 {
     if (tribe_get_option('tribeDisableTribeBar', false) == true) {
         $after = '</div>';
         echo $after;
     }
 }
开发者ID:chicosilva,项目名称:olharambiental,代码行数:12,代码来源:tribe-events-bar.class.php


示例4: show_related_workshops

function show_related_workshops()
{
    if (tribe_get_option('hideRelatedWorkshops', false) == true) {
        return false;
    }
    return true;
}
开发者ID:david-yoshida,项目名称:radii-tec-association,代码行数:7,代码来源:radii-tec-assocation.php


示例5: queue_import

 /**
  * Queues the import on the Aggregator service
  */
 public function queue_import($args = array())
 {
     $meetup_api_key = tribe_get_option('meetup_api_key');
     $defaults = array('meetup_api_key' => $meetup_api_key);
     $args = wp_parse_args($args, $defaults);
     return parent::queue_import($args);
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:10,代码来源:Meetup.php


示例6: __construct

 public function __construct($data = array())
 {
     parent::__construct($data);
     if (!isset($data['name'])) {
         $this->name = 'eventlist';
     }
     if (!isset($data['posts'])) {
         $event_args = array();
         // Get the active plugins.
         $active_plugins = get_option('active_plugins');
         // We do some guessing here for Tzolkin
         if (in_array('tzolkin/tzolkin.php', $active_plugins)) {
             $event_args = ['post_type' => 'tz_events'];
         }
         // Some more guessing for The Events Calendar
         if (in_array('the-events-calendar/the-events-calendar.php', $active_plugins)) {
             $event_args = ['post_type' => \Tribe__Events__Main::POSTTYPE, 'orderby' => 'event_date', 'order' => 'ASC', 'posts_per_page' => tribe_get_option('postsPerPage', 10), 'tribe_render_context' => 'default'];
         }
         $eventlist_event_args_filter = $this->name . '_event_args';
         $event_args = apply_filters($eventlist_event_args_filter, $event_args);
         Atom::add_debug_entry('Filter', $eventlist_event_args_filter);
         $this->posts = new \WP_Query($event_args);
     }
     if (!isset($data['posts-structure'])) {
         $posts_structure = ['PostClass' => ['children' => ['image', 'text']], 'image' => ['parts' => ['PostThumbnail']], 'text' => ['parts' => ['EventBadge', 'PostTitleLink', 'EventDate', 'ForceExcerpt', 'PostLink' => 'Read More']]];
         $postlist_posts_structure_filter = $this->name . '_posts_structure';
         $this->posts_structure = apply_filters($postlist_posts_structure_filter, $posts_structure);
         Atom::add_debug_entry('Filter', $postlist_posts_structure_filter);
     }
 }
开发者ID:Clark-Nikdel-Powell,项目名称:Pattern-Library,代码行数:30,代码来源:event-list.php


示例7: enqueue_calendar_widget_styles

 /**
  * Enqueue the appropriate CSS for the calendar/advanced list widgets, which share
  * the same basic appearance.
  */
 public static function enqueue_calendar_widget_styles()
 {
     // CSS file
     $event_file = 'widget-calendar.css';
     $event_file_option = 'widget-calendar-theme.css';
     $stylesheet_option = tribe_get_option('stylesheetOption', 'tribe');
     // Choose the appropriate stylesheet in light of the current styling options
     switch ($stylesheet_option) {
         case 'skeleton':
         case 'full':
             $event_file_option = "widget-calendar-{$stylesheet_option}.css";
             break;
     }
     $style_url = tribe_events_pro_resource_url($event_file_option);
     $style_url = apply_filters('tribe_events_pro_widget_calendar_stylesheet_url', $style_url);
     $style_override_url = Tribe__Events__Templates::locate_stylesheet('tribe-events/pro/' . $event_file, $style_url);
     // Load up stylesheet from theme or plugin
     if ($style_url && 'tribe' === $stylesheet_option) {
         wp_enqueue_style('widget-calendar-pro-style', tribe_events_pro_resource_url('widget-calendar-full.css'), array(), apply_filters('tribe_events_pro_css_version', Tribe__Events__Pro__Main::VERSION));
         wp_enqueue_style(Tribe__Events__Main::POSTTYPE . '-widget-calendar-pro-style', $style_url, array(), apply_filters('tribe_events_pro_css_version', Tribe__Events__Pro__Main::VERSION));
     } else {
         wp_enqueue_style(Tribe__Events__Main::POSTTYPE . '-widget-calendar-pro-style', $style_url, array(), apply_filters('tribe_events_pro_css_version', Tribe__Events__Pro__Main::VERSION));
     }
     if ($style_override_url) {
         wp_enqueue_style(Tribe__Events__Main::POSTTYPE . '--widget-calendar-pro-override-style', $style_override_url, array(), apply_filters('tribe_events_pro_css_version', Tribe__Events__Pro__Main::VERSION));
     }
 }
开发者ID:acutedeveloper,项目名称:havering-intranet-development,代码行数:31,代码来源:Widgets.php


示例8: ajax_response

 /**
  * AJAX handler for the Map view
  */
 public function ajax_response()
 {
     $tribe_paged = !empty($_POST['tribe_paged']) ? $_POST['tribe_paged'] : 1;
     Tribe__Events__Query::init();
     $post_status = array('publish');
     if (is_user_logged_in()) {
         $post_status[] = 'private';
     }
     $defaults = array('post_type' => Tribe__Events__Main::POSTTYPE, 'posts_per_page' => tribe_get_option('postsPerPage', 10), 'paged' => $tribe_paged, 'post_status' => $post_status, 'eventDisplay' => 'map', 'tribe_geoloc' => true);
     $view_state = 'map';
     /* if past view */
     if (!empty($_POST['tribe_event_display']) && $_POST['tribe_event_display'] == 'past') {
         $view_state = 'past';
         $defaults['eventDisplay'] = 'past';
         $defaults['order'] = 'DESC';
     }
     if (isset($_POST['tribe_event_category'])) {
         $defaults[Tribe__Events__Main::TAXONOMY] = $_POST['tribe_event_category'];
     }
     if (isset($_POST[Tribe__Events__Main::TAXONOMY])) {
         $defaults[Tribe__Events__Main::TAXONOMY] = $_POST[Tribe__Events__Main::TAXONOMY];
     }
     $query = Tribe__Events__Query::getEvents($defaults, true);
     $have_events = 0 < $query->found_posts;
     if ($have_events && Tribe__Events__Pro__Geo_Loc::instance()->is_geoloc_query()) {
         $lat = isset($_POST['tribe-bar-geoloc-lat']) ? $_POST['tribe-bar-geoloc-lat'] : 0;
         $lng = isset($_POST['tribe-bar-geoloc-lng']) ? $_POST['tribe-bar-geoloc-lng'] : 0;
         Tribe__Events__Pro__Geo_Loc::instance()->assign_distance_to_posts($query->posts, $lat, $lng);
     } elseif (!$have_events && isset($_POST['tribe-bar-geoloc'])) {
         Tribe__Notice::set_notice('event-search-no-results', sprintf(__('No results were found for events in or near <strong>"%s"</strong>.', 'tribe-events-calendar-pro'), esc_html($_POST['tribe-bar-geoloc'])));
     } elseif (!$have_events && isset($_POST['tribe_event_category'])) {
         Tribe__Notice::set_notice('events-not-found', sprintf(__('No matching events listed under %s. Please try viewing the full calendar for a complete list of events.', 'tribe-events-calendar-pro'), esc_html($_POST['tribe_event_category'])));
     } elseif (!$have_events) {
         Tribe__Notice::set_notice('event-search-no-results', __('There were no results found.', 'tribe-events-calendar-pro'));
     }
     $response = array('html' => '', 'markers' => array(), 'success' => true, 'tribe_paged' => $tribe_paged, 'max_pages' => $query->max_num_pages, 'total_count' => $query->found_posts, 'view' => $view_state);
     // @TODO: clean this up / refactor the following conditional
     if ($have_events) {
         global $wp_query, $post;
         $data = $query->posts;
         $post = $query->posts[0];
         $wp_query = $query;
         Tribe__Events__Main::instance()->displaying = 'map';
         ob_start();
         tribe_get_view('pro/map/content');
         $response['html'] .= ob_get_clean();
         $response['markers'] = Tribe__Events__Pro__Geo_Loc::instance()->generate_markers($data);
     } else {
         global $wp_query;
         $wp_query = $query;
         Tribe__Events__Main::instance()->setDisplay();
         ob_start();
         tribe_get_view('pro/map/content');
         $response['html'] .= ob_get_clean();
     }
     $response = apply_filters('tribe_events_ajax_response', $response);
     header('Content-type: application/json');
     echo json_encode($response);
     exit;
 }
开发者ID:acutedeveloper,项目名称:havering-intranet-development,代码行数:63,代码来源:Map.php


示例9: queue_import

 /**
  * Queues the import on the Aggregator service
  */
 public function queue_import($args = array())
 {
     $fb_token = tribe_get_option('fb_token');
     $defaults = array('facebook_token' => $fb_token);
     $args = wp_parse_args($args, $defaults);
     return parent::queue_import($args);
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:10,代码来源:Facebook.php


示例10: tribe_events_the_mini_calendar_title

/**
 * Output a link for the mini calendar month previous nav, includes data attributes needed to update the month with ajax
 *
 * @return void
 **/
function tribe_events_the_mini_calendar_title()
{
    $args = tribe_events_get_mini_calendar_args();
    $date = strtotime($args['eventDate']);
    $date_format = tribe_get_option('monthAndYearFormat', 'M Y');
    $title = tribe_event_format_date($date, false, $date_format);
    echo apply_filters('tribe_events_the_mini_calendar_title', $title);
}
开发者ID:TravisSperry,项目名称:mpa_website,代码行数:13,代码来源:widgets.php


示例11: filter_tribe_events_google_maps_api

 /**
  * Adds the browser key api key to the Google Maps JavaScript API url if set by the user.
  *
  * @param string $js_maps_api_url
  *
  * @return string
  */
 public function filter_tribe_events_google_maps_api($js_maps_api_url)
 {
     $key = tribe_get_option($this->api_key_option_name);
     if (!empty($key)) {
         $js_maps_api_url = add_query_arg('key', $key, $js_maps_api_url);
     }
     return $js_maps_api_url;
 }
开发者ID:nullify005,项目名称:shcc-website,代码行数:15,代码来源:Maps_API_Key.php


示例12: is_version_in_db_less_than

 private function is_version_in_db_less_than($version)
 {
     $version_in_db = tribe_get_option('pro-schema-version', 0);
     if (version_compare($version, $version_in_db) > 0) {
         return TRUE;
     }
     return FALSE;
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:8,代码来源:tribeeventspro-schemaupdater.php


示例13: get_abbreviation

 public static function get_abbreviation()
 {
     $unit = tribe_get_option('geoloc_default_unit', 'miles');
     if ($unit == 'miles') {
         return _x('mi', 'Abbreviation for the miles unit of measure', 'the-events-calendar');
     } else {
         return _x('km', 'Abbreviation for the kilometers unit of measure', 'the-events-calendar');
     }
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:9,代码来源:Radius.php


示例14: __construct

 /**
  * constructor
  */
 public function __construct()
 {
     $this->default_venue = (int) tribe_get_option('eventsDefaultVenueID', 0);
     $this->default_organizer = (int) tribe_get_option('eventsDefaultOrganizerID', 0);
     if (class_exists('TribeCommunityEvents')) {
         $community = TribeCommunityEvents::instance();
         $this->default_community_venue = (int) $community->getOption('defaultCommunityVenueID', 0);
         $this->default_community_organizer = (int) $community->getOption('defaultCommunityOrganizerID', 0);
     }
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:13,代码来源:tribe-amalgamator.php


示例15: test_previous_ecp_versions_saving

 /**
  * Check to make sure that 'previous_ecp_versions' is saving correctly.
  *
  * @since 2.0.5
  * @author Paul Hughes
  */
 function test_previous_ecp_versions_saving()
 {
     $tribe_ecp = TribeEvents::instance();
     $tribe_ecp->init();
     $tribe_ecp->setOption('latest_ecp_version', '1.6.5');
     $tribe_ecp->init();
     $previous_ecp_versions = tribe_get_option('previous_ecp_versions');
     $this->assertEquals('0', $previous_ecp_versions[0]);
     $this->assertEquals('1.6.5', $previous_ecp_versions[1]);
     $this->assertFalse(isset($previous_ecp_versions[2]));
 }
开发者ID:mpaskew,项目名称:isc-dev,代码行数:17,代码来源:tribe-previous-ecp-versions.Test.php


示例16: toggle_recurring_events

 /**
  * Modify the database appropriately to reflect the current
  * recurring events status
  */
 public function toggle_recurring_events()
 {
     $current_status = tribe_get_option('recurring_events_are_hidden', false);
     if ($current_status == 'hidden' && $this->recurring) {
         $this->restore_hidden_events();
         tribe_update_option('recurring_events_are_hidden', 'exposed');
     } elseif ($current_status == 'exposed' && !$this->recurring) {
         $this->hide_recurring_events();
         tribe_update_option('recurring_events_are_hidden', 'hidden');
     } elseif (!$current_status) {
         tribe_update_option('recurring_events_are_hidden', $this->recurring ? 'exposed' : 'hidden');
     }
 }
开发者ID:TMBR,项目名称:johnjohn,代码行数:17,代码来源:Recurring_Event_Cleanup.php


示例17: __construct

 /**
  * Set the notices used on month view
  *
  * @param array $args Set of $wp_query params for the month view, if none passed then will default to $wp_query
  * @since 3.0
  */
 public function __construct($args = null)
 {
     if ($args === null) {
         global $wp_query;
         $args = $wp_query->query;
     }
     self::$args = $args;
     self::$posts_per_page_limit = apply_filters('tribe_events_month_day_limit', tribe_get_option('monthEventAmount', '3'));
     if (!tribe_is_month()) {
         $this->asset_packages = array();
     }
     parent::__construct();
 }
开发者ID:paarthd,项目名称:gslvpa,代码行数:19,代码来源:month.php


示例18: tribe_embed_google_map

 /**
  * Google Map Embed Test
  *
  * Check if embed google map is enabled for this event (or venue ).
  *
  * @category Events
  *
  * @param int $postId Id of the post, if none specified, current post is used
  *
  * @return bool True if google map option is set to embed the map
  */
 function tribe_embed_google_map($postId = null)
 {
     $output = false;
     $postId = Tribe__Events__Main::postIdHelper($postId);
     $post_type = get_post_type($postId);
     if (tribe_get_option('embedGoogleMaps', true)) {
         if ($post_type == Tribe__Events__Main::POSTTYPE) {
             $output = get_post_meta($postId, '_EventShowMap', 1) == 1;
         } elseif ($post_type == Tribe__Events__Main::VENUE_POST_TYPE) {
             $output = get_post_meta($postId, '_VenueShowMap', 1) !== 'false' ? 1 : 0;
         }
     }
     return apply_filters('tribe_embed_google_map', $output);
 }
开发者ID:NallelyFlores89,项目名称:cronica-ambiental,代码行数:25,代码来源:google-map.php


示例19: wpv_upcoming_events_title

function wpv_upcoming_events_title($title)
{
    $upcoming = wpv_get_option('tribe-events-upcoming-title');
    $past = wpv_get_option('tribe-events-past-title');
    $month = wpv_get_option('tribe-events-month-title');
    if (!empty($upcoming) && (tribe_is_upcoming() || function_exists('tribe_is_map') && tribe_is_map() || function_exists('tribe_is_photo') && tribe_is_photo())) {
        return $upcoming;
    } elseif (!empty($past) && tribe_is_past()) {
        return $past;
    } elseif (!empty($month) && tribe_is_month()) {
        return sprintf($month, date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())));
    }
    return $title;
}
开发者ID:petrfaitl,项目名称:wordpress-event-theme,代码行数:14,代码来源:tribe-events-integration.php


示例20: widget_output

 /**
  * The main widget output function (called by the class's widget() function).
  *
  * @param array $args
  * @param array $instance
  * @param string $template_name The template name.
  * @param string $subfolder The subfolder where the template can be found.
  * @param string $namespace The namespace for the widget template stuff.
  * @param string $pluginPath The pluginpath so we can locate the template stuff.
  */
 function widget_output($args, $instance, $template_name = 'list-widget', $subfolder = 'widgets', $namespace = '/', $pluginPath = '')
 {
     global $wp_query, $tribe_ecp, $post;
     extract($args, EXTR_SKIP);
     // The view expects all these $instance variables, which may not be set without pro
     $instance = wp_parse_args($instance, array('limit' => 5, 'title' => ''));
     extract($instance, EXTR_SKIP);
     // extracting $instance provides $title, $limit
     $title = apply_filters('widget_title', $title);
     if (!isset($category) || $category === '-1') {
         $category = 0;
     }
     if (tribe_get_option('viewOption') == 'upcoming') {
         $event_url = tribe_get_listview_link($category);
     } else {
         $event_url = tribe_get_gridview_link($category);
     }
     if (function_exists('tribe_get_events')) {
         $args = array('eventDisplay' => 'upcoming', 'posts_per_page' => $limit);
         if (!empty($category)) {
             $args['tax_query'] = array(array('taxonomy' => TribeEvents::TAXONOMY, 'terms' => $category, 'field' => 'ID', 'include_children' => false));
         }
         $posts = tribe_get_events($args);
     }
     // if no posts, and the don't show if no posts checked, let's bail
     if (!$posts && $no_upcoming_events) {
         return;
     }
     /* Before widget (defined by themes). */
     echo $before_widget;
     /* Title of widget (before and after defined by themes). */
     echo $title ? $before_title . $title . $after_title : '';
     if ($posts) {
         /* Display list of events. */
         echo '<ol class="hfeed vcalendar">';
         foreach ($posts as $post) {
             setup_postdata($post);
             include TribeEventsTemplates::getTemplateHierarchy('widgets/list-widget.php');
         }
         echo "</ol><!-- .hfeed -->";
         /* Display link to all events */
         echo '<p class="tribe-events-widget-link"><a href="' . $event_url . '" rel="bookmark">' . __('View All Events', 'tribe-events-calendar') . '</a></p>';
     } else {
         echo '<p>' . __('There are no upcoming events at this time.', 'tribe-events-calendar') . '</p>';
     }
     /* After widget (defined by themes). */
     echo $after_widget;
     wp_reset_query();
 }
开发者ID:paarthd,项目名称:gslvpa,代码行数:59,代码来源:widget-list.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP tribe_get_organizer函数代码示例发布时间:2022-05-23
下一篇:
PHP tribe_get_next_month_text函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap