本文整理汇总了PHP中Tribe__Events__Main类的典型用法代码示例。如果您正苦于以下问题:PHP Tribe__Events__Main类的具体用法?PHP Tribe__Events__Main怎么用?PHP Tribe__Events__Main使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Tribe__Events__Main类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor!
*/
protected function __construct()
{
$this->main = Tribe__Events__Main::instance();
$this->register_default_linked_post_types();
add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'));
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:10,代码来源:Linked_Posts.php
示例2: setup
protected function setup()
{
Tribe__Events__Main::instance()->displaying = 'day';
$this->shortcode->prepare_default();
Tribe__Events__Pro__Template_Factory::asset_package('ajax-dayview');
$this->shortcode->set_template_object(new Tribe__Events__Template__Day($this->shortcode->get_query_args()));
}
开发者ID:TakenCdosG,项目名称:chefs,代码行数:7,代码来源:Day.php
示例3: __construct
/**
* Sets up and renders the event meta box for the specified existing event
* or for a new event (if $event === null).
*
* @param null $event
*/
public function __construct($event = null)
{
$this->tribe = Tribe__Events__Main::instance();
$this->get_event($event);
$this->setup_data();
$this->do_meta_box();
}
开发者ID:bostondv,项目名称:the-events-calendar,代码行数:13,代码来源:Event_Meta_Box.php
示例4: 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
示例5: filter_tribe_events_rewrite_i18n_slugs_raw
/**
* Filters the bases used to generate TEC rewrite rules to use WPML managed translations.
*
* @param array $bases
* @param string $method
* @param array $domains
*
* @return array An array of bases each with its (optional) WPML managed translations set.
*/
public function filter_tribe_events_rewrite_i18n_slugs_raw($bases, $method, $domains)
{
/** @var SitePress $sitepress */
global $sitepress, $sitepress_settings;
if (empty($sitepress) || !is_a($sitepress, 'SitePress')) {
return $bases;
}
$tec = Tribe__Events__Main::instance();
// Grab all languages
$langs = $sitepress->get_active_languages();
if (empty($langs)) {
return $bases;
}
foreach ($langs as $lang) {
$languages[] = $sitepress->get_locale($lang['code']);
}
// Prevent Duplicates and Empty langs
$languages = array_filter(array_unique($languages));
// Query the Current Language
$current_locale = $sitepress->get_locale($sitepress->get_current_language());
// Get the strings on multiple Domains and Languages
// remove WPML filter to avoid the locale being set to the default one
remove_filter('locale', array($sitepress, 'locale_filter'));
$bases = $tec->get_i18n_strings($bases, $languages, $domains, $current_locale);
// re-hook WPML filter
add_filter('locale', array($sitepress, 'locale_filter'));
$string_translation_active = function_exists('wpml_st_load_slug_translation');
$post_slug_translation_on = !empty($sitepress_settings['posts_slug_translation']['on']);
if ($string_translation_active && $post_slug_translation_on) {
$bases = $this->translate_single_slugs($bases);
}
return $bases;
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:42,代码来源:Filters.php
示例6: getOption
/**
* Get value for a specific option
*
* @param string $optionName name of option
* @param string $default default value
*
* @return mixed results of option query
*/
public static function getOption($optionName, $default = '')
{
if (!$optionName) {
return null;
}
$value = Tribe__Events__Main::getOption($optionName, $default);
return apply_filters('tribe-import-setting-' . $optionName, $value, $default);
}
开发者ID:TMBR,项目名称:johnjohn,代码行数:16,代码来源:Options.php
示例7: wpv_tribe_single_gmap
function wpv_tribe_single_gmap()
{
$the_id = tribe_get_venue_id($GLOBALS['wpv_single_event_id']);
$the_address = Tribe__Events__Main::instance()->fullAddressString($the_id);
if (get_post_meta($GLOBALS['wpv_single_event_id'], '_EventShowMap', true) == '1') {
echo WPV_Gmap::shortcode(array('address' => $the_address, 'height' => 500, 'html' => $the_address, 'popup' => true, 'scrollwheel' => false));
}
}
开发者ID:petrfaitl,项目名称:wordpress-event-theme,代码行数:8,代码来源:tribe-events-integration.php
示例8: test_get_constant_update_callbacks
public function test_get_constant_update_callbacks()
{
$current_version = Tribe__Events__Main::VERSION;
$updater = Tribe__Events__Main::instance()->updater();
$contant_updates = $updater->get_constant_update_callbacks();
foreach ($contant_updates as $contant_update_callable) {
$this->assertTrue(is_callable($contant_update_callable), 'checking constant update function is callable');
}
}
开发者ID:sperrhaken,项目名称:the-events-calendar,代码行数:9,代码来源:Updater_Test.php
示例9: setup
protected function setup()
{
Tribe__Events__Main::instance()->displaying = 'list';
$this->shortcode->set_current_page();
$this->shortcode->prepare_default();
Tribe__Events__Template_Factory::asset_package('ajax-list');
$this->template = new Tribe__Events__Template__List($this->shortcode->get_query_args());
$this->shortcode->set_template_object($this->template);
}
开发者ID:TakenCdosG,项目名称:chefs,代码行数:9,代码来源:List.php
示例10: maybe_add_admin_notice
/**
* Hooks the action to show an admin notice if a page with the `/events` slug exists on the site.
*/
public function maybe_add_admin_notice()
{
$this->archive_slug = Tribe__Events__Main::instance()->getOption('eventsSlug', 'events');
$page = get_page_by_path($this->archive_slug);
if (!$page || $page->post_status == 'trash') {
return;
}
$this->page = $page;
add_action('admin_notices', array($this, 'notice'));
}
开发者ID:hubbardsc,项目名称:field_day,代码行数:13,代码来源:Archive_Slug_Conflict.php
示例11: tribe_venue_upcoming_events
/**
* Output the upcoming events associated with a venue
*
* @return string|null
*/
function tribe_venue_upcoming_events($post_id = false)
{
$post_id = Tribe__Events__Main::postIdHelper($post_id);
if ($post_id) {
$args = array('venue' => $post_id, 'eventDisplay' => 'list', 'posts_per_page' => apply_filters('tribe_events_single_venue_posts_per_page', 100));
$html = tribe_include_view_list($args);
return apply_filters('tribe_venue_upcoming_events', $html);
}
return null;
}
开发者ID:TakenCdosG,项目名称:chefs,代码行数:15,代码来源:venue.php
示例12: setup
protected function setup()
{
Tribe__Events__Main::instance()->displaying = 'photo';
$this->shortcode->set_current_page();
$this->shortcode->prepare_default();
Tribe__Events__Pro__Main::instance()->enqueue_pro_scripts();
Tribe__Events__Pro__Template_Factory::asset_package('events-pro-css');
Tribe__Events__Pro__Template_Factory::asset_package('ajax-photoview');
$this->shortcode->set_template_object(new Tribe__Events__Pro__Templates__Photo($this->shortcode->get_query_args()));
}
开发者ID:TakenCdosG,项目名称:chefs,代码行数:10,代码来源:Photo.php
示例13: 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 = Tribe__Events__Main::instance();
$tec_rewrite_slug = trailingslashit($tec->rewriteSlug);
// create new rule for the agenda view
$newRules = array($tec_rewrite_slug . 'agenda/?$' => 'index.php?post_type=' . Tribe__Events__Main::POSTTYPE . '&eventDisplay=agenda');
// Add the new rule to the global rewrite rules array
$wp_rewrite->rules = $newRules + $wp_rewrite->rules;
}
开发者ID:rlaloux,项目名称:tribe-events-agenda-view,代码行数:16,代码来源:tribe-events-agenda-view.php
示例14: saveEventMeta
/**
* Used by createEvent and updateEvent - saves all the various event meta
*
* @param int $event_id The event ID we are modifying meta for.
* @param array $data The meta fields we want saved.
* @param WP_Post The event itself.
*
*/
public static function saveEventMeta($event_id, $data, $event = null)
{
$tec = Tribe__Events__Main::instance();
$data = self::prepare_event_date_meta($event_id, $data);
if (empty($data['EventHideFromUpcoming'])) {
delete_metadata('post', $event_id, '_EventHideFromUpcoming');
}
update_metadata('post', $event_id, '_EventShowMapLink', isset($data['venue']['EventShowMapLink']));
update_metadata('post', $event_id, '_EventShowMap', isset($data['venue']['EventShowMap']));
if (isset($data['post_status'])) {
$post_status = $data['post_status'];
} else {
$post_status = get_post_status($event_id);
}
// Handle the submission of linked post type posts (like venue and organizer)
Tribe__Events__Linked_Posts::instance()->handle_submission($event_id, $data);
// Ordinarily there is a single cost value for each event, but addons (ie, ticketing plugins) may need
// to record a number of different pricepoints for the same event
$event_cost = isset($data['EventCost']) ? (array) $data['EventCost'] : array();
$data['EventCost'] = (array) apply_filters('tribe_events_event_costs', $event_cost, $event_id);
if (isset($data['FeaturedImage']) && !empty($data['FeaturedImage'])) {
update_metadata('post', $event_id, '_thumbnail_id', $data['FeaturedImage']);
unset($data['FeaturedImage']);
}
do_action('tribe_events_event_save', $event_id);
//update meta fields
foreach ($tec->metaTags as $tag) {
$htmlElement = ltrim($tag, '_');
if (isset($data[$htmlElement]) && $tag != Tribe__Events__Main::EVENTSERROROPT) {
if (is_string($data[$htmlElement])) {
$data[$htmlElement] = filter_var($data[$htmlElement], FILTER_SANITIZE_STRING);
}
// Fields with multiple values per key
if (is_array($data[$htmlElement])) {
delete_metadata('post', $event_id, $tag);
foreach ($data[$htmlElement] as $value) {
add_metadata('post', $event_id, $tag, $value);
}
} else {
update_metadata('post', $event_id, $tag, $data[$htmlElement]);
}
}
}
// Set sticky state for calendar view.
if ($event instanceof WP_Post) {
if (isset($data['EventShowInCalendar']) && $data['EventShowInCalendar'] == 'yes' && $event->menu_order != '-1') {
$update_event = array('ID' => $event_id, 'menu_order' => '-1');
wp_update_post($update_event);
} elseif ((!isset($data['EventShowInCalendar']) || $data['EventShowInCalendar'] != 'yes') && $event->menu_order == '-1') {
$update_event = array('ID' => $event_id, 'menu_order' => '0');
wp_update_post($update_event);
}
}
do_action('tribe_events_update_meta', $event_id, $data);
}
开发者ID:nullify005,项目名称:shcc-website,代码行数:63,代码来源:API.php
示例15: embed_head
/**
* Adds content to the embed head tag
*
* The embed header DOES NOT have wp_head() executed inside of it. Instead, any scripts/styles
* are explicitly output
*/
public function embed_head()
{
$css_path = Tribe__Events__Template_Factory::getMinFile(Tribe__Events__Main::instance()->plugin_url . 'src/resources/css/tribe-events-embed.css', true);
$css_path = add_query_arg('ver', Tribe__Events__Main::VERSION, $css_path);
?>
<link rel="stylesheet" id="tribe-events-embed-css" href="<?php
echo esc_url($css_path);
?>
" type="text/css" media="all">
<?php
}
开发者ID:nullify005,项目名称:shcc-website,代码行数:17,代码来源:Embed.php
示例16: 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
**/
function tribe_events_the_mini_calendar_next_link()
{
$tribe_ecp = Tribe__Events__Main::instance();
$args = tribe_events_get_mini_calendar_args();
try {
$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>»</span></a>';
} catch (OverflowException $e) {
$html = '';
}
echo apply_filters('tribe_events_the_mini_calendar_next_link', $html);
}
开发者ID:TravisSperry,项目名称:mpa_website,代码行数:16,代码来源:widgets.php
示例17: __construct
public function __construct($event = null, $post_type = null)
{
$this->tribe = Tribe__Events__Main::instance();
$this->linked_posts = Tribe__Events__Linked_Posts::instance();
$this->post_type = $post_type;
$this->singular_name = $this->linked_posts->linked_post_types[$this->post_type]['singular_name'];
$this->singular_name_lowercase = $this->linked_posts->linked_post_types[$this->post_type]['singular_name_lowercase'];
$this->get_event($event);
add_action('wp', array($this, 'sticky_form_data'), 50);
// Later than events-admin.js itself is enqueued
}
开发者ID:nullify005,项目名称:shcc-website,代码行数:11,代码来源:Chooser_Meta_Box.php
示例18: __construct
/**
* Setup all the hooks and filters
*
* @return void
*/
private function __construct()
{
$plugin = Tribe__Events__Main::instance();
// Hook the AJAX methods
add_action('wp_ajax_tribe_convert_legacy_facebook_settings', array($this, 'ajax_convert_facebook_settings'));
add_action('wp_ajax_tribe_convert_legacy_ical_settings', array($this, 'ajax_convert_ical_settings'));
// Hook the Notice for the Migration
tribe_notice('tribe-aggregator-migrate-legacy-settings', array($this, 'notice'), 'type=warning');
// Register Assets
tribe_asset($plugin, 'tribe-migrate-legacy-settings', 'aggregator-admin-legacy-settings.js', array('jquery'), 'admin_enqueue_scripts');
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:16,代码来源:Migrate.php
示例19: 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.
*/
function tribe_get_gcal_link($postId = null)
{
$postId = Tribe__Events__Main::postIdHelper($postId);
$output = Tribe__Events__Main::instance()->googleCalendarLink($postId);
/**
* Filters the Google Calendar gcal link
*
* @param string $output Gcal link
* @param int $postId WP Post ID of an event
*/
return apply_filters('tribe_get_gcal_link', $output, $postId);
}
开发者ID:hubbardsc,项目名称:field_day,代码行数:21,代码来源:ical.php
示例20: handle
public function handle()
{
$http = is_ssl() ? 'https' : 'http';
$url = apply_filters('tribe_events_pro_google_maps_api', $http . '://maps.google.com/maps/api/js');
wp_register_script('tribe-gmaps', $url, array('tribe-events-pro'));
$path = Tribe__Events__Template_Factory::getMinFile(tribe_events_pro_resource_url('tribe-events-ajax-maps.js'), true);
wp_register_script('tribe-events-pro-geoloc', $path, array('tribe-gmaps', Tribe__Events__Template_Factory::get_placeholder_handle()), apply_filters('tribe_events_pro_js_version', Tribe__Events__Pro__Main::VERSION));
wp_enqueue_script('tribe-events-pro-geoloc');
$geoloc = Tribe__Events__Pro__Geo_Loc::instance();
$data = array('ajaxurl' => admin_url('admin-ajax.php', $http), 'nonce' => wp_create_nonce('tribe_geosearch'), 'map_view' => 'map' == Tribe__Events__Main::instance()->displaying ? true : false);
wp_localize_script('tribe-events-pro-geoloc', 'GeoLoc', $data);
}
开发者ID:TakenCdosG,项目名称:chefs,代码行数:12,代码来源:Ajax_Maps.php
注:本文中的Tribe__Events__Main类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论