本文整理汇总了PHP中tribe_events_resource_url函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_events_resource_url函数的具体用法?PHP tribe_events_resource_url怎么用?PHP tribe_events_resource_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_events_resource_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
public function handle()
{
$ajax_data = array('ajaxurl' => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'), 'post_type' => Tribe__Events__Main::POSTTYPE);
$path = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('tribe-events-ajax-day.js'), true);
$handle = 'tribe-events-ajax-day';
wp_enqueue_script($handle, $path, array('tribe-events-bar'), $this->filter_js_version(), true);
wp_localize_script($handle, 'TribeCalendar', $ajax_data);
}
示例2: handle
public function handle()
{
$deps = array_merge($this->deps, array('jquery'), Tribe__Events__Template_Factory::get_vendor_scripts());
$path = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('tribe-events.js'), true);
$handle = $this->prefix . '-calendar-script';
wp_enqueue_script($handle, $path, $deps, $this->filter_js_version());
$js_config_array = array('permalink_settings' => get_option('permalink_structure'), 'events_post_type' => Tribe__Events__Main::POSTTYPE, 'events_base' => tribe_get_events_link());
wp_localize_script($handle, 'tribe_js_config', $js_config_array);
}
示例3: handle
public function handle()
{
$deps = array_merge($this->deps, array('jquery', $this->prefix . '-bootstrap-datepicker', $this->prefix . '-calendar-script'));
$ajax_data = array("ajaxurl" => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'));
$path = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('tribe-events-ajax-calendar.js'), true);
$handle = 'tribe-events-calendar';
wp_enqueue_script($handle, $path, $deps, $this->filter_js_version(), true);
wp_localize_script($handle, 'TribeCalendar', $ajax_data);
}
示例4: handle
public function handle()
{
$deps = array_merge($this->deps, array('jquery', $this->prefix . '-calendar-script'));
$tribe_paged = !empty($_REQUEST['tribe_paged']) ? $_REQUEST['tribe_paged'] : 0;
$ajax_data = array('ajaxurl' => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'), 'tribe_paged' => $tribe_paged);
$path = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('tribe-events-ajax-list.js'), true);
$handle = 'tribe-events-list';
wp_enqueue_script($handle, $path, $deps, $this->filter_js_version(), true);
wp_localize_script($handle, 'TribeList', $ajax_data);
}
示例5: add_admin_scripts
/**
* Enqueue the tickets metabox JS and CSS
* @static
*
* @param $hook
*/
public static function add_admin_scripts($hook)
{
global $post;
$modules = apply_filters('tribe_events_tickets_modules', null);
/* Only load the resources in the event edit screen, and if there's a provider available */
if ($hook != 'post-new.php' && $hook != 'post.php' || Tribe__Events__Main::POSTTYPE != $post->post_type || empty($modules)) {
return;
}
wp_enqueue_style('events-tickets', tribe_events_resource_url('tickets.css'), array(), apply_filters('tribe_events_css_version', Tribe__Events__Main::VERSION));
wp_enqueue_script('events-tickets', tribe_events_resource_url('tickets.js'), array(), apply_filters('tribe_events_js_version', Tribe__Events__Main::VERSION));
$upload_header_data = array('title' => __('Ticket header image', 'tribe-events-calendar'), 'button' => __('Set as ticket header', 'tribe-events-calendar'));
wp_localize_script('events-tickets', 'HeaderImageData', $upload_header_data);
$nonces = array('add_ticket_nonce' => wp_create_nonce('add_ticket_nonce'), 'edit_ticket_nonce' => wp_create_nonce('edit_ticket_nonce'), 'remove_ticket_nonce' => wp_create_nonce('remove_ticket_nonce'));
wp_localize_script('events-tickets', 'TribeTickets', $nonces);
}
示例6: handle
public function handle()
{
// check if responsive should be killed
if (apply_filters('tribe_events_kill_responsive', false)) {
add_filter('tribe_events_mobile_breakpoint', '__return_zero');
}
$stylesheets = array();
$mobile_break = tribe_get_mobile_breakpoint();
// Get the selected style option
$style_option = tribe_get_option('stylesheetOption', 'tribe');
// from `some-style-option`
// to `Tribe__Events__Asset__Events_Css_Some_Style_Option`
$child_class_name = $this->get_child_class_name($style_option);
/**
* @var Tribe__Events__Asset__Abstract_Events_Css
*/
$child_class_instance = new $child_class_name();
// `$stylesheets` passed by reference
$child_class_instance->handle($stylesheets, $mobile_break);
// put override css at the end of the array
$stylesheets['tribe-events-calendar-override-style'] = 'tribe-events/tribe-events.css';
// do the enqueues
foreach ($stylesheets as $name => $css_file) {
if ($name == 'tribe-events-calendar-override-style') {
$user_stylesheet_url = Tribe__Events__Templates::locate_stylesheet('tribe-events/tribe-events.css');
if ($user_stylesheet_url) {
wp_enqueue_style($name, $user_stylesheet_url);
}
} else {
// get full URL
$url = tribe_events_resource_url($css_file);
// get the minified file
$url = Tribe__Events__Template_Factory::getMinFile($url, true);
// apply filters
$url = apply_filters('tribe_events_stylesheet_url', $url, $name);
// set the $media attribute
if ($name == 'tribe-events-calendar-mobile-style' || $name == 'tribe-events-calendar-full-mobile-style') {
$media = "only screen and (max-width: {$mobile_break}px)";
wp_enqueue_style($name, $url, array('tribe-events-calendar-style'), Tribe__Events__Main::VERSION, $media);
} else {
wp_register_style($name, $url, array(), Tribe__Events__Main::VERSION);
wp_enqueue_style($name);
}
}
}
}
示例7: addAdminScriptsAndStyles
/**
* Add admin scripts and styles
*
* @return void
*/
public function addAdminScriptsAndStyles()
{
global $current_screen;
// setup plugin resources & 3rd party vendor urls
$vendor_url = trailingslashit($this->pluginUrl) . 'vendor/';
// admin stylesheet - only load admin stylesheet when on Tribe pages
if (isset($current_screen->id) && true === strpos($current_screen->id, 'tribe')) {
wp_enqueue_style(self::POSTTYPE . '-admin', tribe_events_resource_url('events-admin.css'), array(), apply_filters('tribe_events_css_version', self::VERSION));
}
// settings screen
if (isset($current_screen->id) && $current_screen->id == 'settings_page_tribe-settings') {
// chosen
Tribe__Events__Template_Factory::asset_package('chosen');
// JS admin
Tribe__Events__Template_Factory::asset_package('admin');
// JS settings
Tribe__Events__Template_Factory::asset_package('settings');
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
// hook for other plugins
do_action('tribe_settings_enqueue');
}
if ($current_screen->id == 'widgets') {
Tribe__Events__Template_Factory::asset_package('chosen');
}
// events, organizer, or venue editing
if (isset($current_screen->post_type) && in_array($current_screen->post_type, array(self::POSTTYPE, self::VENUE_POST_TYPE, self::ORGANIZER_POST_TYPE))) {
// chosen
Tribe__Events__Template_Factory::asset_package('chosen');
// select 2
Tribe__Events__Template_Factory::asset_package('select2');
// smoothness
Tribe__Events__Template_Factory::asset_package('smoothness');
// date picker
Tribe__Events__Template_Factory::asset_package('datepicker');
// dialog
Tribe__Events__Template_Factory::asset_package('dialog');
// UI admin
Tribe__Events__Template_Factory::asset_package('admin-ui');
// JS admin
Tribe__Events__Template_Factory::asset_package('admin');
// ecp placeholders
Tribe__Events__Template_Factory::asset_package('ecp-plugins');
switch ($current_screen->post_type) {
case self::POSTTYPE:
add_action('admin_footer', array($this, 'printLocalizedAdmin'));
// hook for other plugins
do_action('tribe_events_enqueue');
break;
case self::VENUE_POST_TYPE:
// hook for other plugins
do_action('tribe_venues_enqueue');
break;
case self::ORGANIZER_POST_TYPE:
// hook for other plugins
do_action('tribe_organizers_enqueue');
break;
}
}
}
示例8: maybe_display_aggregator_upsell
/**
* Renders the "Missing Aggregator License" notice
*
* @return string
*/
public function maybe_display_aggregator_upsell()
{
if (defined('TRIBE_HIDE_UPSELL')) {
return;
}
if (Tribe__Events__Aggregator::instance()->is_service_active()) {
return;
}
ob_start();
?>
<div class="notice inline notice-info tribe-dependent tribe-notice-tribe-missing-aggregator-license" data-ref="tribe-missing-aggregator-license" data-depends="#tribe-ea-field-origin" data-condition-empty>
<div class="upsell-banner">
<img src="<?php
echo esc_url(tribe_events_resource_url('images/aggregator/upsell-banner.png'));
?>
">
</div>
<h3><?php
esc_html_e('Import Using Event Aggregator', 'the-events-calendar');
?>
</h3>
<p><?php
esc_html_e('With Event Aggregator, you can import events from Facebook, iCalendar, Google, and Meetup.com in a jiffy.', 'the-events-calendar');
?>
</p>
<a href="http://m.tri.be/196y" class="tribe-license-link tribe-button tribe-button-primary" target="_blank">
<?php
esc_html_e('Buy It Now', 'the-events-calendar');
?>
<span class="screen-reader-text">
<?php
esc_html_e('opens in a new window', 'the-events-calendar');
?>
</span>
</a>
<a href="http://m.tri.be/196z" class="tribe-license-link tribe-button tribe-button-secondary" target="_blank">
<?php
esc_html_e('Learn More', 'the-events-calendar');
?>
<span class="screen-reader-text">
<?php
esc_html_e('opens in a new window', 'the-events-calendar');
?>
</span>
</a>
</div>
<?php
return ob_get_clean();
}
示例9: tribe_events_the_mini_calendar_prev_link
<thead class="tribe-mini-calendar-nav">
<tr>
<td colspan="7">
<div>
<?php
tribe_events_the_mini_calendar_prev_link();
?>
<span id="tribe-mini-calendar-month"><?php
tribe_events_the_mini_calendar_title();
?>
</span>
<?php
tribe_events_the_mini_calendar_next_link();
?>
<img id="ajax-loading-mini" src="<?php
echo tribe_events_resource_url('images/tribe-loading.gif');
?>
" alt="loading..." />
</div>
</td>
</tr>
</thead>
<?php
do_action('tribe_events_mini_cal_after_header');
?>
<?php
do_action('tribe_events_mini_cal_before_the_grid');
?>
<thead>
<tr>
<?php
示例10: enqueue_map_scripts
protected function enqueue_map_scripts()
{
// Setup Google Maps API
$url = apply_filters('tribe_events_google_maps_api', '//maps.googleapis.com/maps/api/js');
wp_enqueue_script('tribe_events_google_maps_api', $url, array(), false, true);
// Setup our own script used to initialize each map
$url = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('embedded-map.js'), true);
wp_enqueue_script(self::MAP_HANDLE, $url, array('tribe_events_google_maps_api'), false, true);
$this->map_script_enqueued = true;
}
示例11: enqueue
/**
* Enqueue the styles and script
*/
public function enqueue()
{
wp_enqueue_style('app-shop', tribe_events_resource_url('app-shop.css'), array(), apply_filters('tribe_events_css_version', Tribe__Events__Main::VERSION));
wp_enqueue_script('app-shop', tribe_events_resource_url('app-shop.js'), array(), apply_filters('tribe_events_js_version', Tribe__Events__Main::VERSION));
}
示例12: handle
public function handle()
{
$deps = array_merge($this->deps, array('jquery', $this->prefix . '-calendar-script', $this->prefix . '-bootstrap-datepicker', $this->prefix . '-jquery-resize', Tribe__Events__Template_Factory::get_placeholder_handle()));
$path = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('tribe-events-bar.js'), true);
wp_enqueue_script($this->prefix . '-bar', $path, $deps, $this->filter_js_version());
}
示例13: handle
public function handle()
{
$path = Tribe__Events__Template_Factory::getMinFile(tribe_events_resource_url('events-admin.css'), true);
wp_enqueue_style($this->prefix . '-admin-ui', $path, array(), Tribe__Events__Main::VERSION);
}
示例14: tribe_events_before_html
/**
* HTML Before Event (Display)
*
* Display HTML to output before the event template
*
* @category Events
*/
function tribe_events_before_html()
{
$events_label_plural = tribe_get_event_label_plural();
$before = stripslashes(tribe_get_option('tribeEventsBeforeHTML', ''));
$before = wptexturize($before);
$before = convert_chars($before);
$before = wpautop($before);
$before = do_shortcode(stripslashes(shortcode_unautop($before)));
$before = '<div class="tribe-events-before-html">' . $before . '</div>';
$before = $before . '<span class="tribe-events-ajax-loading"><img class="tribe-events-spinner-medium" src="' . tribe_events_resource_url('images/tribe-loading.gif') . '" alt="' . sprintf(__('Loading %s', 'tribe-events-calendar'), $events_label_plural) . '" /></span>';
echo apply_filters('tribe_events_before_html', $before);
}
示例15: asset_package
//.........这里部分代码省略.........
case 'settings':
$deps = array_merge($deps, array('jquery'));
$path = self::getMinFile($resources_url . 'tribe-settings.js', true);
wp_enqueue_script($prefix . '-settings', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION), true);
break;
case 'ecp-plugins':
$deps = array_merge($deps, array('jquery'));
$path = self::getMinFile($resources_url . 'jquery-ecp-plugins.js', true);
wp_enqueue_script($prefix . '-ecp-plugins', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION));
break;
case 'tribe-events-bar':
$deps = array_merge($deps, array('jquery', $prefix . '-calendar-script', $prefix . '-bootstrap-datepicker', $prefix . '-jquery-resize', self::get_placeholder_handle()));
$path = self::getMinFile($resources_url . 'tribe-events-bar.js', true);
wp_enqueue_script($prefix . '-bar', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION));
break;
case 'jquery-placeholder':
// Vendor: jQuery Placeholder
$deps = array_merge($deps, array('jquery'));
$path = self::getMinFile($vendor_url . 'jquery-placeholder/jquery.placeholder.js', true);
$placeholder_handle = self::get_placeholder_handle();
wp_enqueue_script($placeholder_handle, $path, $deps, '2.0.7', false);
self::$vendor_scripts[] = $placeholder_handle;
break;
case 'ajax-calendar':
$deps = array_merge($deps, array('jquery', $prefix . '-bootstrap-datepicker', $prefix . '-calendar-script'));
$ajax_data = array("ajaxurl" => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'));
$path = self::getMinFile($resources_url . 'tribe-events-ajax-calendar.js', true);
wp_enqueue_script('tribe-events-calendar', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION), true);
wp_localize_script('tribe-events-calendar', 'TribeCalendar', $ajax_data);
break;
case 'ajax-list':
$deps = array_merge($deps, array('jquery', $prefix . '-calendar-script'));
$tribe_paged = !empty($_REQUEST['tribe_paged']) ? $_REQUEST['tribe_paged'] : 0;
$ajax_data = array("ajaxurl" => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'), 'tribe_paged' => $tribe_paged);
$path = self::getMinFile($resources_url . 'tribe-events-ajax-list.js', true);
wp_enqueue_script('tribe-events-list', $path, $deps, apply_filters('tribe_events_js_version', TribeEvents::VERSION), true);
wp_localize_script('tribe-events-list', 'TribeList', $ajax_data);
break;
case 'events-css':
// check if responsive should be killed
if (apply_filters('tribe_events_kill_responsive', false)) {
add_filter('tribe_events_mobile_breakpoint', '__return_zero');
}
$stylesheets = array();
$mobile_break = tribe_get_mobile_breakpoint();
// Get the selected style option
$style_option = tribe_get_option('stylesheetOption', 'tribe');
// Determine the stylesheet files for the selected option
switch ($style_option) {
case 'skeleton':
$stylesheets['tribe-events-calendar-style'] = 'tribe-events-skeleton.css';
break;
case 'full':
$stylesheets['tribe-events-calendar-style'] = 'tribe-events-full.css';
if ($mobile_break > 0) {
$stylesheets['tribe-events-calendar-mobile-style'] = 'tribe-events-full-mobile.css';
}
break;
default:
// tribe styles
$stylesheets['tribe-events-full-calendar-style'] = 'tribe-events-full.css';
$stylesheets['tribe-events-calendar-style'] = 'tribe-events-theme.css';
if ($mobile_break > 0) {
$stylesheets['tribe-events-calendar-full-mobile-style'] = 'tribe-events-full-mobile.css';
$stylesheets['tribe-events-calendar-mobile-style'] = 'tribe-events-theme-mobile.css';
}
break;
}
// put override css at the end of the array
$stylesheets['tribe-events-calendar-override-style'] = 'tribe-events/tribe-events.css';
// do the enqueues
foreach ($stylesheets as $name => $css_file) {
if ($name == 'tribe-events-calendar-override-style') {
$user_stylesheet_url = TribeEventsTemplates::locate_stylesheet('tribe-events/tribe-events.css');
if ($user_stylesheet_url) {
wp_enqueue_style($name, $user_stylesheet_url);
}
} else {
// get full URL
$url = tribe_events_resource_url($css_file);
// get the minified file
$url = self::getMinFile($url, true);
// apply filters
$url = apply_filters('tribe_events_stylesheet_url', $url, $name);
// set the $media attribute
if ($name == 'tribe-events-calendar-mobile-style' || $name == 'tribe-events-calendar-full-mobile-style') {
$media = "(max-width: {$mobile_break}px)";
wp_enqueue_style($name, $url, array('tribe-events-calendar-style'), TribeEvents::VERSION, $media);
} else {
wp_register_style($name, $url, array(), TribeEvents::VERSION);
wp_enqueue_style($name);
}
}
}
break;
default:
do_action($prefix . '-' . $name);
break;
}
}