當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TribeEvents::instance方法代碼示例

本文整理匯總了PHP中TribeEvents::instance方法的典型用法代碼示例。如果您正苦於以下問題:PHP TribeEvents::instance方法的具體用法?PHP TribeEvents::instance怎麽用?PHP TribeEvents::instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TribeEvents的用法示例。


在下文中一共展示了TribeEvents::instance方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: hack_to_remove_broken_filters

 private function hack_to_remove_broken_filters()
 {
     // a stupid hack for some stupid code
     // the callback will automatically replace every Venue title with "Unnamed Venue"
     $TribeEvents = TribeEvents::instance();
     remove_action('save_post', array($TribeEvents, 'save_venue_data'), 16, 2);
 }
開發者ID:scttrgd,項目名稱:scottish-piping,代碼行數:7,代碼來源:TribeEventsImporter_FileImporter_Venues.php

示例2: init

 /**
  * Initialize the class and place hooks and styling.
  */
 function init()
 {
     $this->title(__('Tribe', 'tribe-events-calendar'));
     remove_action('tribe_debug', array(TribeEvents::instance(), 'renderDebug'), 10, 2);
     add_action('tribe_debug', array($this, 'logDebug'), 8, 3);
     wp_enqueue_style('tribe-debugger', TribeEvents::instance()->pluginUrl . 'resources/debugger.css');
 }
開發者ID:TyRichards,項目名稱:river_of_life,代碼行數:10,代碼來源:tribe-debug-bar.class.php

示例3: set_notices

 /**
  * Set the notices used on week view
  *
  * @since  3.0
  * @author tim@imaginesimplicty.com
  * @return void
  * */
 function set_notices()
 {
     global $wp_query;
     $tribe = TribeEvents::instance();
     $search_term = $geographic_term = '';
     $tax_term = '';
     // We have events to display, no need for notices!
     if (!empty(self::$events->all_day) || !empty(self::$events->hourly)) {
         return;
     }
     if (is_tax($tribe->get_event_taxonomy())) {
         $tax_term = get_term_by('slug', get_query_var('term'), $tribe->get_event_taxonomy());
         $tax_term = esc_html($tax_term->name);
     }
     // Was the user searching for a keyword or place?
     if (!empty($wp_query->query_vars['s'])) {
         $search_term = $wp_query->query_vars['s'];
     } elseif (!empty($_REQUEST['tribe-bar-search'])) {
         $search_term = $_REQUEST['tribe-bar-search'];
     } elseif (!empty($_REQUEST['tribe-bar-geoloc'])) {
         $geographic_term = $_REQUEST['tribe-bar-geoloc'];
     }
     // Set an appropriate notice
     if (!empty($search_term)) {
         TribeEvents::setNotice('event-search-no-results', sprintf(__('There were no results found for <strong>"%s"</strong> this week. Try searching another week.', 'tribe-events-calendar-pro'), esc_html($search_term)));
     } elseif (!empty($geographic_term)) {
         TribeEvents::setNotice('event-search-no-results', sprintf(__('No results were found for events in or near <strong>"%s"</strong> this week. Try searching another week.', 'tribe-events-calendar-pro'), esc_html($geographic_term)));
     } elseif (!empty($tax_term)) {
         TribeEvents::setNotice('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'), $tax_term));
     } else {
         TribeEvents::setNotice('event-search-no-results', __('No results were found for this week. Try searching another week.', 'tribe-events-calendar-pro'));
     }
 }
開發者ID:pellio11,項目名稱:ns-select-project,代碼行數:40,代碼來源:week.php

示例4: tribe_events_the_mini_calendar_next_link

/**
 * Output a link for the mini calendar month next nav, includes data attributes needed to update the month with ajax
 *
 * @return void
 * @since 3.0
 * @author Jessica Yazbek
 **/
function tribe_events_the_mini_calendar_next_link()
{
    $tribe_ecp = TribeEvents::instance();
    $args = tribe_events_get_mini_calendar_args();
    $html = '<a class="tribe-mini-calendar-nav-link next-month" href="#" data-month="' . $tribe_ecp->nextMonth($args['eventDate']) . '-01" title="' . tribe_get_next_month_text() . '"><span>&raquo;</span></a>';
    echo apply_filters('tribe_events_the_mini_calendar_prev_link', $html);
}
開發者ID:TyRichards,項目名稱:river_of_life,代碼行數:14,代碼來源:widgets.php

示例5: tribe_attachment_404_fix

function tribe_attachment_404_fix()
{
    if (class_exists('TribeEvents')) {
        remove_action('init', array(TribeEvents::instance(), 'init'), 10);
        add_action('init', array(TribeEvents::instance(), 'init'), 1);
    }
}
開發者ID:gabriel-dehan,項目名稱:erdf-sessions,代碼行數:7,代碼來源:functions.php

示例6: _backend_load_event_of_date

function _backend_load_event_of_date()
{
    if (isset($_POST['event_date']) && $_POST['event_date']) {
        TribeEventsQuery::init();
        $states[] = 'publish';
        if (0 < get_current_user_id()) {
            $states[] = 'private';
        }
        $args = array('post_status' => $states, 'eventDate' => $_POST["event_date"], 'eventDisplay' => 'day');
        TribeEvents::instance()->displaying = 'day';
        $query = TribeEventsQuery::getEvents($args, true);
        global $wp_query, $post;
        $wp_query = $query;
        add_filter('tribe_is_day', '__return_true');
        $html = '';
        if ($query->have_posts()) {
            while ($query->have_posts()) {
                $query->the_post();
                $html .= '<option value="' . get_the_ID() . '"> ' . get_the_title() . '</option>';
            }
            wp_reset_postdata();
        }
        $response = array('html' => $html, 'success' => true, 'total_count' => $query->found_posts, 'view' => 'day');
        header('Content-type: application/json');
        echo json_encode($response);
        die;
    }
}
開發者ID:morganloehr,項目名稱:chris-verna,代碼行數:28,代碼來源:event.php

示例7: tribe_get_gcal_link

 /**
  * Google Calendar Link
  *
  * Returns an "add to Google Calendar link for a single event. Must be used in the loop
  *
  * @param int $postId (optional)
  *
  * @return string URL for google calendar.
  * @since 2.0
  */
 function tribe_get_gcal_link($postId = null)
 {
     $postId = TribeEvents::postIdHelper($postId);
     $tribe_ecp = TribeEvents::instance();
     $output = esc_url($tribe_ecp->googleCalendarLink($postId));
     return apply_filters('tribe_get_gcal_link', $output);
 }
開發者ID:jvcanote,項目名稱:wp-the-events-calendar,代碼行數:17,代碼來源:ical.php

示例8: form

 function form($instance)
 {
     /* Set up default widget settings. */
     $defaults = array('title' => 'Upcoming Events', 'limit' => '5', 'no_upcoming_events' => false);
     $instance = wp_parse_args((array) $instance, $defaults);
     $tribe_ecp = TribeEvents::instance();
     include $tribe_ecp->pluginPath . 'admin-views/widget-admin-list.php';
 }
開發者ID:mpaskew,項目名稱:isc-dev,代碼行數:8,代碼來源:widget-list.class.php

示例9: single_event_meta

 /**
  * single_event_meta
  * 
  * loads the custom field meta box on the event editor screen
  * 
  * @return void
  */
 public static function single_event_meta()
 {
     $tribe_ecp = TribeEvents::instance();
     $customFields = tribe_get_option('custom-fields');
     $events_event_meta_template = TribeEventsPro::instance()->pluginPath . 'admin-views/event-meta.php';
     $events_event_meta_template = apply_filters('tribe_events_event_meta_template', $events_event_meta_template);
     include $events_event_meta_template;
 }
開發者ID:mpaskew,項目名稱:isc-dev,代碼行數:15,代碼來源:tribe-ecp-custom-meta.class.php

示例10: krafit_event_meta_cats

/**
 * Replaces tribe_event_meta_cats();
 */
function krafit_event_meta_cats($label = null, $separator = ', ')
{
    if (!$label) {
        $label = '';
    }
    $tribe_ecp = TribeEvents::instance();
    $list = apply_filters('krafit_event_meta_cats', get_the_term_list(get_the_ID(), $tribe_ecp->get_event_taxonomy(), '<h3 class="event-preheader">' . $label . '', $separator, '</h3>'));
    echo $list;
}
開發者ID:krafit,項目名稱:planck,代碼行數:12,代碼來源:the-events-calendar.php

示例11: column_order_status

 function column_order_status($item)
 {
     $icon = "";
     if (strtolower($item['order_status']) !== 'completed') {
         $tec = TribeEvents::instance();
         $icon = sprintf("<span class='warning'><img src='%s'/></span> ", trailingslashit($tec->pluginUrl) . 'resources/warning.png');
     }
     return $icon . ucwords($item['order_status']);
 }
開發者ID:mpaskew,項目名稱:isc-dev,代碼行數:9,代碼來源:tribe-tickets-attendees.php

示例12: tribe_events_agenda_add_routes

/**
 * Add the agenda view rewrite rule
 *
 * @param $wp_rewrite the WordPress rewrite rules object
 * @return void
 **/
function tribe_events_agenda_add_routes($wp_rewrite)
{
    // Get the instance of the TribeEvents plugin, and the rewriteSlug that the plugin uses
    $tec = TribeEvents::instance();
    $tec_rewrite_slug = trailingslashit($tec->rewriteSlug);
    // create new rule for the agenda view
    $newRules = array($tec_rewrite_slug . 'agenda/?$' => 'index.php?post_type=' . TribeEvents::POSTTYPE . '&eventDisplay=agenda');
    // Add the new rule to the global rewrite rules array
    $wp_rewrite->rules = $newRules + $wp_rewrite->rules;
}
開發者ID:Renddslow,項目名稱:tribe-events-agenda-view,代碼行數:16,代碼來源:tribe-events-agenda-view.php

示例13: 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

示例14: attendees_page_load_css_js

 /**
  * Enqueues the JS and CSS for the attendees page in the admin
  * @param $hook
  */
 public function attendees_page_load_css_js($hook)
 {
     if ($hook != $this->attendees_page) {
         return;
     }
     $ecp = TribeEvents::instance();
     wp_enqueue_style(TribeEventsTicketsPro::$attendees_slug, trailingslashit($ecp->pluginUrl) . 'resources/tickets-attendees.css', array(), apply_filters('tribe_events_css_version', TribeEvents::VERSION));
     wp_enqueue_style(TribeEventsTicketsPro::$attendees_slug . '-print', trailingslashit($ecp->pluginUrl) . 'resources/tickets-attendees-print.css', array(), apply_filters('tribe_events_css_version', TribeEvents::VERSION), 'print');
     wp_enqueue_script(TribeEventsTicketsPro::$attendees_slug, trailingslashit($ecp->pluginUrl) . 'resources/tickets-attendees.js', array('jquery'), apply_filters('tribe_events_js_version', TribeEvents::VERSION));
     $mail_data = array('nonce' => wp_create_nonce('email-attendee-list'), 'required' => __('You need to select a user or type a valid email address', 'tribe-events-calendar'), 'sending' => __('Sending...', 'tribe-events-calendar'), 'checkin_nonce' => wp_create_nonce('checkin'), 'uncheckin_nonce' => wp_create_nonce('uncheckin'));
     wp_localize_script(TribeEventsTicketsPro::$attendees_slug, 'Attendees', $mail_data);
 }
開發者ID:donwea,項目名稱:nhap.org,代碼行數:16,代碼來源:tribe-tickets-pro.php

示例15: ajax_response

 /**
  * AJAX handler for the Map view
  */
 function ajax_response()
 {
     $tribe_paged = !empty($_POST['tribe_paged']) ? $_POST['tribe_paged'] : 1;
     TribeEventsQuery::init();
     $defaults = array('post_type' => TribeEvents::POSTTYPE, 'posts_per_page' => tribe_get_option('postsPerPage', 10), 'paged' => $tribe_paged, 'post_status' => array('publish'), 'eventDisplay' => 'map');
     $view_state = 'map';
     /* if past view */
     if (!empty($_POST['tribe_event_display']) && $_POST['tribe_event_display'] == 'past') {
         $view_state = 'past';
         $defaults['eventDisplay'] = 'past';
     }
     if (isset($_POST['tribe_event_category'])) {
         $defaults[TribeEvents::TAXONOMY] = $_POST['tribe_event_category'];
     }
     $query = TribeEventsQuery::getEvents($defaults, true);
     $have_events = 0 < $query->found_posts;
     if ($have_events && TribeEventsGeoLoc::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;
         TribeEventsGeoLoc::instance()->assign_distance_to_posts($query->posts, $lat, $lng);
     } elseif (!$have_events && isset($_POST['tribe-bar-geoloc'])) {
         TribeEvents::setNotice('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'])) {
         TribeEvents::setNotice('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'), esc_html($_POST['tribe_event_category'])));
     } elseif (!$have_events) {
         TribeEvents::setNotice('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;
         TribeEvents::instance()->displaying = 'map';
         ob_start();
         tribe_get_view('pro/map/content');
         $response['html'] .= ob_get_clean();
         $response['markers'] = TribeEventsGeoLoc::instance()->generate_markers($data);
     } else {
         global $wp_query;
         $wp_query = $query;
         TribeEvents::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:TMBR,項目名稱:johnjohn,代碼行數:55,代碼來源:map.php


注:本文中的TribeEvents::instance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。