Пример #1
0
 /**
  * Registers the shortcode hook.
  *
  * @uses \add_shortcode()
  * @uses \shortcode_exists()
  */
 public final function add()
 {
     if (\shortcode_exists($this->tag)) {
         throw new \Exception("Shortcode `{$this->tag}` exists.");
     }
     \add_shortcode($this->tag, array($this, 'output'));
 }
 /**
  * Verify validity of ajax request and pass it to the internal handler
  */
 function debug_bar_shortcodes_do_ajax()
 {
     // Verify this is a valid ajax request
     if (wp_verify_nonce($_POST['dbs-nonce'], 'debug-bar-shortcodes') === false) {
         exit('-1');
     }
     // Verify we have received the data needed to do anything
     if (!isset($_POST['shortcode']) || $_POST['shortcode'] === '') {
         exit('-1');
     }
     include_once plugin_dir_path(__FILE__) . 'class-debug-bar-shortcodes-info.php';
     $info = new Debug_Bar_Shortcodes_Info();
     $shortcode = $_POST['shortcode'];
     $shortcode = trim($shortcode);
     // Exit early if this is a non-existent shortcode - shouldn't happen, but hack knows ;-)
     if (shortcode_exists($shortcode) === false) {
         $response = array('id' => 0, 'data' => '');
         $info->send_ajax_response($response);
         exit;
     }
     // Send the request to our handler
     switch ($_POST['action']) {
         case 'debug-bar-shortcodes-find':
             $info->ajax_find_shortcode_uses($shortcode);
             break;
         case 'debug-bar-shortcodes-retrieve':
             $info->ajax_retrieve_details($shortcode);
             break;
     }
     /* No valid action received (redundancy, can't really happen as wp wouldn't then call this
        function, but would return 0 and exit already */
     exit('-1');
 }
function cases_display_todo_comments()
{
    if (!is_singular('cases')) {
        return;
    }
    if (!shortcode_exists('cp_todo_comments')) {
        return;
    }
    global $post;
    $args = array('post_id' => $post->ID, 'meta_query' => array(array('key' => 'cp_control', 'value' => 'yes')), 'meta_key' => 'cp_control_order', 'orderby' => 'meta_value_num', 'order' => 'ASC');
    $comments_query = new WP_Comment_Query();
    $comments = $comments_query->query($args);
    if (empty($comments)) {
        return;
    }
    ?>
	<section id="case_todo_comments_wrapper" class="cases-box">
		<header class="cases-box-header">
			<h1>Комментарии на контроле</h1>
			<hr>
		</header>
		<article class="cases-box-content">
			<?php 
    echo do_shortcode('[cp_todo_comments]');
    ?>
		</article>
	</section>
<?php 
}
Пример #4
0
 /**
  * Search a string for ingot shortcodes and return ids used
  *
  * @since 1.1.0
  *
  * @param string $content String to search
  *
  * @return array Array of group IDs
  */
 public static function find_ids($content)
 {
     $ids = [];
     $tag = 'ingot';
     if (!has_shortcode($content, $tag) || false === strpos($content, '[')) {
         return $ids;
     }
     if (shortcode_exists($tag)) {
         preg_match_all('/' . get_shortcode_regex() . '/', $content, $matches, PREG_SET_ORDER);
         if (empty($matches)) {
             return $ids;
         }
         foreach ($matches as $shortcode) {
             if ($tag === $shortcode[2] && isset($shortcode[3])) {
                 $_id = self::find_id($shortcode);
                 if (is_numeric($_id)) {
                     $ids[] = $_id;
                 }
             } elseif (!empty($shortcode[5]) && has_shortcode($shortcode[5], $tag)) {
                 $_id = self::find_id($shortcode);
                 if (is_numeric($_id)) {
                     $ids[] = $_id;
                 }
             }
         }
     }
     return $ids;
 }
 public static function register_shortcode()
 {
     // backward compatible, but only load if no other plugin has registered this shortcode
     if (!shortcode_exists('podlove-subscribe-button')) {
         add_shortcode('podlove-subscribe-button', [__CLASS__, 'button']);
     }
     add_shortcode('podlove-podcast-subscribe-button', [__CLASS__, 'button']);
 }
 public function __construct()
 {
     add_shortcode('ultimate-recipe', array($this, 'recipe_shortcode'));
     // Fallback after importing
     if (!shortcode_exists('cooked-recipe')) {
         add_shortcode('cooked-recipe', array($this, 'recipe_shortcode'));
     }
 }
Пример #7
0
 public function __construct($settings)
 {
     $this->settings = $settings;
     $this->shortcode = $this->settings['base'];
     $this->addAction('admin_init', 'enqueueAssets');
     if ($this->isAdmin() || !shortcode_exists($this->shortcode)) {
         $this->addShortCode($this->shortcode, array($this, 'output'));
     }
 }
 public function __construct($settings)
 {
     $settings = wp_parse_args($settings, array('id' => '', 'title' => __('Element Title', 'detheme_builder'), 'icon' => 'dashicons-admin-page', 'options' => array()));
     $this->settings = $settings;
     $this->shortcode = $this->settings['id'];
     if (!shortcode_exists($this->shortcode)) {
         add_shortcode($this->shortcode, array($this, 'output'));
     }
 }
/**
 * Audio helper script.
 *
 * If an audio shortcode exists we will enqueue javascript
 * that replaces all non-supported audio player instances
 * with text links.
 *
 * @uses shortcode_exists();
 */
function next_saturday_audio_script()
{
    if (shortcode_exists('audio')) {
        return;
    }
    if (!is_singular() || has_post_format('audio')) {
        wp_enqueue_script('next-saturday-audio', get_template_directory_uri() . '/js/audio.js', array(), '20130521');
    }
}
Пример #10
0
 protected function register_shortcodes()
 {
     $this->shortcodes = array('wpqt-icon' => array('function' => 'the_custom_icon', 'description' => __('Rendering the custom icons', $this->domain_name), 'since' => '1.0.0'), 'wpqt-permalink' => array('function' => 'get_qiita_link', 'description' => __('Rendering the Qiita side permalink of specified post', $this->domain_name), 'since' => '1.0.0'), 'wpqt-post-stocks' => array('function' => 'get_post_stocks', 'description' => __('Rendering the number of stock of the specified post', $this->domain_name), 'since' => '1.0.0'));
     foreach ($this->shortcodes as $shortcode_name => $shortcode_atts) {
         if (false === shortcode_exists($shortcode_name)) {
             add_shortcode($shortcode_name, array($this, $shortcode_atts['function']));
         }
     }
 }
 /**
  * Registers the custom post types and adds action/filter handlers, but
  * only if the site supports it
  */
 function maybe_register_cpt()
 {
     // Add an option to enable the CPT
     add_action('admin_init', array($this, 'settings_api_init'));
     // Check on theme switch if theme supports CPT and setting is disabled
     add_action('after_switch_theme', array($this, 'activation_post_type_support'));
     $setting = get_option(self::OPTION_NAME, '0');
     // Bail early if Testimonial option is not set and the theme doesn't declare support
     if (empty($setting) && !$this->site_supports_custom_post_type()) {
         return;
     }
     // Enable Omnisearch for CPT.
     if (class_exists('Jetpack_Omnisearch_Posts')) {
         new Jetpack_Omnisearch_Posts(self::CUSTOM_POST_TYPE);
     }
     // CPT magic
     $this->register_post_types();
     add_action(sprintf('add_option_%s', self::OPTION_NAME), array($this, 'flush_rules_on_enable'), 10);
     add_action(sprintf('update_option_%s', self::OPTION_NAME), array($this, 'flush_rules_on_enable'), 10);
     add_action(sprintf('publish_%s', self::CUSTOM_POST_TYPE), array($this, 'flush_rules_on_first_testimonial'));
     add_action('after_switch_theme', array($this, 'flush_rules_on_switch'));
     // Admin Customization
     add_filter('enter_title_here', array($this, 'change_default_title'));
     add_filter(sprintf('manage_%s_posts_columns', self::CUSTOM_POST_TYPE), array($this, 'edit_title_column_label'));
     add_filter('post_updated_messages', array($this, 'updated_messages'));
     add_action('customize_register', array($this, 'customize_register'));
     // Only add the 'Customize' sub-menu if the theme supports it.
     $num_testimonials = self::count_testimonials();
     if (!empty($num_testimonials) && current_theme_supports(self::CUSTOM_POST_TYPE)) {
         add_action('admin_menu', array($this, 'add_customize_page'));
     }
     if (defined('IS_WPCOM') && IS_WPCOM) {
         // Track all the things
         add_action(sprintf('add_option_%s', self::OPTION_NAME), array($this, 'new_activation_stat_bump'));
         add_action(sprintf('update_option_%s', self::OPTION_NAME), array($this, 'update_option_stat_bump'), 11, 2);
         add_action(sprintf('publish_%s', self::CUSTOM_POST_TYPE), array($this, 'new_testimonial_stat_bump'));
         // Add to Dotcom XML sitemaps
         add_filter('wpcom_sitemap_post_types', array($this, 'add_to_sitemap'));
     } else {
         // Add to Jetpack XML sitemap
         add_filter('jetpack_sitemap_post_types', array($this, 'add_to_sitemap'));
     }
     // Adjust CPT archive and custom taxonomies to obey CPT reading setting
     add_filter('pre_get_posts', array($this, 'query_reading_setting'), 20);
     add_filter('infinite_scroll_settings', array($this, 'infinite_scroll_click_posts_per_page'));
     // Register [jetpack_testimonials] always and
     // register [testimonials] if [testimonials] isn't already set
     add_shortcode('jetpack_testimonials', array($this, 'jetpack_testimonial_shortcode'));
     if (!shortcode_exists('testimonials')) {
         add_shortcode('testimonials', array($this, 'jetpack_testimonial_shortcode'));
     }
     // If CPT was enabled programatically and no CPT items exist when user switches away, disable
     if ($setting && $this->site_supports_custom_post_type()) {
         add_action('switch_theme', array($this, 'deactivation_post_type_support'));
     }
 }
Пример #12
0
 function __construct()
 {
     parent::__construct(array('name' => __('Slider', 'themify'), 'slug' => 'slider'));
     ///////////////////////////////////////
     // Load Post Type
     ///////////////////////////////////////
     $this->meta_box = $this->set_metabox();
     $this->initialize_cpt(array('plural' => __('Slides', 'themify'), 'singular' => __('Slide', 'themify'), 'supports' => array('title', 'editor', 'author', 'custom-fields'), 'menu_icon' => 'dashicons-slides'));
     if (!shortcode_exists('themify_' . $this->slug . '_posts')) {
         add_shortcode('themify_' . $this->slug . '_posts', array($this, 'do_shortcode'));
     }
 }
 function init()
 {
     if (shortcode_exists('featured_products')) {
         remove_shortcode('featured_products');
     }
     if (shortcode_exists('recent_products')) {
         remove_shortcode('recent_products');
     }
     add_shortcode('featured_products', 'bs_featured_products');
     add_shortcode('recent_products', 'bs_recent_products');
     add_action('wp_enqueue_scripts', array(&$this, 'woocommerce_twitterbootstrap_setstylesheets'), 99);
     add_action('shop_loop', array($this, 'bs_shop_loop'), 99);
     add_action('woocommerce_before_single_product_summary', array(&$this, 'woocommerce_before_single_product_summary_bs'), 1);
     add_action('woocommerce_before_single_product_summary', array(&$this, 'woocommerce_before_single_product_summary_bs_end'), 100);
     add_action('woocommerce_after_single_product_summary', array(&$this, 'woocommerce_after_single_product_summary_bs'), 1);
     /* thumbnails */
     add_action('bs_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10);
     add_action('bs_before_shop_loop_item_title', array(&$this, 'bs_get_product_thumbnail'), 10, 3);
     add_action('woocommerce_after_shop_loop', array(&$this, 'endsetupgrid'), 1);
     add_action('woocommerce_before_shop_loop', array(&$this, 'setupgrid'), 999);
     /* the grid display */
     /*
     |  	columns		| mobile 	| tablet 	| desktop	|per page 	|
     ----------------------------------------------------|-----------|
     |		1		|	1		|	1		|	1		| 	10		|
     |---------------------------------------------------|-----------|
     |		2		|	1		|	2		|	2		|	10		|
     |---------------------------------------------------|-----------|
     |		3		|	1		|	1		|	3		|	 9		|
     |---------------------------------------------------|-----------|
     |		3(1)	|	1		|	2		|	3		|	12		|
     |---------------------------------------------------|-----------|
     |		4		|	1		|	2		|	4		|	12		|
     |---------------------------------------------------|-----------|
     |		5		|	n/a		|	n/a		|	n/a		|	n/a	    |
     |---------------------------------------------------|-----------|
     |		6		|	2		|	4		|	6		|	12		|
     |---------------------------------------------------|-----------|
     |		>=6		|	n/a		|	n/a		|	n/a		|	n/a		|
     |---------------------------------------------------------------|
     */
     // Store column count for displaying the grid
     global $woocommerce_loop;
     if (empty($woocommerce_loop['columns'])) {
         $woocommerce_loop['columns'] = get_option('number_of_columns', 4);
     }
     if ($woocommerce_loop['columns'] == 3) {
         add_filter('loop_shop_per_page', create_function('$cols', 'return 9;'), 10);
     } elseif ($woocommerce_loop['columns'] > 2) {
         add_filter('loop_shop_per_page', create_function('$cols', 'return 12;'), 10);
     }
     define('WooCommerce_Twitter_Bootstrap_grid_classes', $this->get_grid_classes($woocommerce_loop));
 }
Пример #14
0
 function __construct()
 {
     parent::__construct(array('name' => __('Testimonial', 'themify'), 'slug' => 'testimonial'));
     ///////////////////////////////////////
     // Load Post Type
     ///////////////////////////////////////
     $this->meta_box = $this->set_metabox();
     $this->initialize_cpt(array('plural' => __('Testimonials', 'themify'), 'singular' => __('Testimonial', 'themify'), 'menu_icon' => 'dashicons-testimonial'));
     if (!shortcode_exists('themify_' . $this->slug . '_posts')) {
         add_shortcode('themify_' . $this->slug . '_posts', array($this, 'do_shortcode'));
     }
 }
 function __construct()
 {
     parent::__construct(array('name' => __('Highlight', 'themify'), 'slug' => 'highlight'));
     ///////////////////////////////////////
     // Load Post Type
     ///////////////////////////////////////
     $this->meta_box = $this->set_metabox();
     $this->initialize_cpt(array('plural' => __('Highlights', 'themify'), 'singular' => __('Highlight', 'themify'), 'menu_icon' => 'dashicons-welcome-write-blog'));
     if (!shortcode_exists('themify_highlight_posts')) {
         add_shortcode('themify_highlight_posts', array($this, 'do_shortcode'));
     }
 }
Пример #16
0
function popmake_emodal_init()
{
    global $popmake_options;
    if (isset($popmake_options['enable_easy_modal_compatibility_mode'])) {
        if (!shortcode_exists('modal')) {
            add_shortcode('modal', 'popmake_emodal_shortcode_modal');
        }
        add_filter('popmake_get_the_popup_data_attr', 'popmake_emodal_get_the_popup_data_attr', 10, 2);
        add_filter('popmake_shortcode_popup_default_atts', 'popmake_emodal_shortcode_popup_default_atts', 10, 2);
        add_filter('popmake_shortcode_data_attr', 'popmake_emodal_shortcode_data_attr', 10, 2);
        add_filter('popmake_popup_is_loadable', 'popmake_emodal_popup_is_loadable', 20, 2);
    }
}
/**
 * Create the excerpt shortcode
 *
 * @param $ods_shortcode
 */
function ods_shortcode($ods_shortcode)
{
    if (shortcode_exists($ods_shortcode)) {
        $pattern = get_shortcode_regex();
        preg_match('/' . $pattern . '/s', get_the_content(), $matches);
        if (!empty($matches)) {
            if (is_array($matches) && $matches[2] == $ods_shortcode) {
                $shortcode = $matches[0];
                echo do_shortcode($shortcode);
            }
        }
    }
}
Пример #18
0
 public function setup_slider_cpt()
 {
     global $ThemifyBuilder;
     if ($ThemifyBuilder->is_cpt_active('slider')) {
         ///////////////////////////////////////
         // Load Post Type
         ///////////////////////////////////////
         $this->meta_box = $this->set_metabox();
         $this->initialize_cpt(array('plural' => __('Slides', 'themify'), 'singular' => __('Slide', 'themify'), 'supports' => array('title', 'editor', 'author', 'custom-fields'), 'menu_icon' => 'dashicons-slides'));
         if (!shortcode_exists('themify_' . $this->slug . '_posts')) {
             add_shortcode('themify_' . $this->slug . '_posts', array($this, 'do_shortcode'));
         }
     }
 }
Пример #19
0
 /**
  * __construct
  */
 function __construct()
 {
     // actions
     add_action('admin_init', array(&$this, 'tinymce_button'));
     foreach (array('post.php', 'post-new.php') as $hook) {
         add_action("admin_head-{$hook}", array(&$this, 'admin_head'));
     }
     add_action('wp_ajax_styled_button_preview', array(&$this, 'preview'));
     add_action('wp_enqueue_scripts', array(&$this, 'enqueue_style'));
     // shortcodes
     if (!shortcode_exists($this->shortcode)) {
         add_shortcode($this->shortcode, array(&$this, 'button_shortcode'));
     }
 }
 function __construct()
 {
     parent::__construct(array('name' => __('Portfolio', 'themify'), 'slug' => 'portfolio'));
     ///////////////////////////////////////
     // Load Post Type
     ///////////////////////////////////////
     include_once ABSPATH . 'wp-admin/includes/plugin.php';
     if (!is_plugin_active('themify-portfolio-post/themify-portfolio-post.php')) {
         $this->meta_box = $this->set_metabox();
         $this->initialize_cpt(array('plural' => __('Portfolios', 'themify'), 'singular' => __('Portfolio', 'themify'), 'rewrite' => apply_filters('themify_portfolio_rewrite', 'project'), 'menu_icon' => 'dashicons-portfolio'));
         if (!shortcode_exists('themify_portfolio_posts')) {
             add_shortcode('themify_portfolio_posts', array($this, 'do_shortcode'));
         }
     }
 }
Пример #21
0
 public function load()
 {
     add_action('wp', [$this, 'embed_player']);
     add_action('wp_enqueue_scripts', function () {
         wp_enqueue_script('podlove-player-moderator-script', plugins_url('js/podlove-web-moderator.min.js', __FILE__), [], \Podlove\get_plugin_header('Version'));
     });
     add_action('wp_print_footer_scripts', function () {
         echo '<script>jQuery("audio").podlovewebplayer();</script>';
     });
     // backward compatible, but only load if no other plugin has registered this shortcode
     if (!shortcode_exists('podlove-web-player')) {
         add_shortcode('podlove-web-player', [__CLASS__, 'shortcode']);
     }
     add_shortcode('podlove-episode-web-player', [__CLASS__, 'shortcode']);
 }
Пример #22
0
 /**
  * Class constructor
  *
  * @since 1.0.0
  *
  * @uses shortcode_exists()
  * @uses VGSR_Shortcode::setup_actions()
  */
 public function __construct($name, $atts = array(), $ui_args = array())
 {
     // Bail when the shortcode already exists or is not callable
     if (shortcode_exists($name)) {
         return;
     }
     // Shortcode details
     $this->name = $name;
     // Parse attribute data
     foreach ((array) $atts as $k => $att) {
         $this->atts[$k] = wp_parse_args($att, array('label' => ucfirst($k), 'description' => '', 'type' => 'text', 'default' => false, 'placeholder' => '', 'required' => false, 'options' => false));
     }
     // Shortcode UI args
     $this->args = wp_parse_args($ui_args, array('label' => __('Shortcode', 'vgsr-widgets'), 'listItemImage' => 'dashicons-sticky'));
 }
Пример #23
0
 /**
  * Conditionally hook into WordPress.
  *
  * Themes must declare that they support this module by adding
  * add_theme_support( 'jetpack-testimonial' ); during after_setup_theme.
  *
  * If no theme support is found there is no need to hook into
  * WordPress. We'll just return early instead.
  */
 function __construct()
 {
     // Add an option to enable the CPT
     add_action('admin_init', array($this, 'settings_api_init'));
     // Check on theme switch if theme supports CPT and setting is disabled
     add_action('after_switch_theme', array($this, 'activation_post_type_support'));
     // Make sure the post types are loaded for imports
     add_action('import_start', array($this, 'register_post_types'));
     $setting = get_option(self::OPTION_NAME, '0');
     // Bail early if Testimonial option is not set and the theme doesn't declare support
     if (empty($setting) && !$this->site_supports_custom_post_type()) {
         return;
     }
     // Enable Omnisearch for Testimonials.
     if (class_exists('Jetpack_Omnisearch_Posts')) {
         new Jetpack_Omnisearch_Posts(self::CUSTOM_POST_TYPE);
     }
     // CPT magic
     $this->register_post_types();
     add_action(sprintf('add_option_%s', self::OPTION_NAME), array($this, 'flush_rules_on_enable'), 10);
     add_action(sprintf('update_option_%s', self::OPTION_NAME), array($this, 'flush_rules_on_enable'), 10);
     add_action(sprintf('publish_%s', self::CUSTOM_POST_TYPE), array($this, 'flush_rules_on_first_testimonial'));
     add_action('after_switch_theme', array($this, 'flush_rules_on_switch'));
     // Admin Customization
     add_filter('enter_title_here', array($this, 'change_default_title'));
     add_filter(sprintf('manage_%s_posts_columns', self::CUSTOM_POST_TYPE), array($this, 'edit_title_column_label'));
     add_filter('post_updated_messages', array($this, 'updated_messages'));
     add_action('customize_register', array($this, 'customize_register'));
     $num_testimonials = self::count_testimonials();
     if (!empty($num_testimonials)) {
         add_action('admin_menu', array($this, 'add_customize_page'));
     }
     add_action('after_switch_theme', array($this, 'flush_rules_on_switch'));
     // Adjust CPT archive and custom taxonomies to obey CPT reading setting
     add_filter('pre_get_posts', array($this, 'query_reading_setting'));
     // If called via REST API, we need to register later in lifecycle
     add_action('restapi_theme_init', array($this, 'maybe_register_cpt'));
     // Register [jetpack_testimonials] always and
     // register [testimonials] if [testimonials] isn't already set
     add_shortcode('jetpack_testimonials', array($this, 'jetpack_testimonial_shortcode'));
     if (!shortcode_exists('testimonials')) {
         add_shortcode('testimonials', array($this, 'jetpack_testimonial_shortcode'));
     }
     // If CPT was enabled programatically and no CPT items exist when user switches away, disable
     if ($setting && $this->site_supports_custom_post_type()) {
         add_action('switch_theme', array($this, 'deactivation_post_type_support'));
     }
 }
 /**
  * Renders shortcode.
  */
 public function render()
 {
     global $post;
     echo '<ul class="recipe-controls">';
     if (shortcode_exists('pinit')) {
         echo '<li>';
         echo do_shortcode('[pinit]');
         echo '</li>';
     }
     $print_link = add_query_arg('print-recipe', '', get_permalink($post->ID));
     echo '<li>';
     echo '<a class="recipe-print" href="' . $print_link . '">';
     echo __('Print Recipe', WP_Recipe::get_instance()->get_slug());
     echo '</a>';
     echo '</li>';
     echo '</ul>';
 }
 /**
  * Using the action of end processing TinyMCE to run the code
  * that allows me to hide the translation to use the plugin
  */
 function register_tinymce_hidden()
 {
     $translate = $this->register_tinymce_translate();
     // Creating division with a hidden div for each
     // shortcode plugin that is active right now in session
     echo '<div id="sz-google-hidden-shortcodes" style="display:none !important">';
     foreach ($translate as $key => $value) {
         if (shortcode_exists($key)) {
             echo '<div class="' . $key . '" ';
             echo 'data-width="' . $value['width'] . '" ';
             echo 'data-height="' . $value['height'] . '" ';
             echo 'data-description="' . $value['title'] . '"';
             echo '></div>';
         }
     }
     echo '</div>';
 }
function column_content($column_name, $post_ID)
{
    if ($column_name == 'shorty') {
        $pid = $post_ID;
        $type = get_post_type($pid);
        if (shortcode_exists($type)) {
            ?>
  <input type="text" readonly value='[<?php 
            echo $type;
            ?>
 id="<?php 
            echo $pid;
            ?>
"]' onFocus="this.select()" />
          <?php 
        }
    }
}
Пример #27
0
 public function init()
 {
     // Adding new shortcodes
     foreach ($this->config as $shortcode => $shortcode_params) {
         if (isset($shortcode_params['disabled']) and $shortcode_params['disabled']) {
             // If the shortcode is disabled, don't handle it at all
             if (!us_get_option('enable_unsupported_vc_shortcodes', FALSE) and shortcode_exists($shortcode)) {
                 remove_shortcode($shortcode);
             }
             continue;
         }
         // Taking over the previous declaration
         if (shortcode_exists($shortcode)) {
             remove_shortcode($shortcode);
         }
         add_shortcode($shortcode, array($this, $shortcode));
     }
     $this->inited = TRUE;
 }
Пример #28
0
 function add_shortcodes()
 {
     global $bontoolkit;
     $bon_toolkit_options = get_option($bontoolkit->option_name);
     add_shortcode('bt-map', array($this, 'map_shortcode'));
     add_shortcode('bt-tabs', array($this, 'tabs_shortcode'));
     add_shortcode('bt-tab', array($this, 'tab_shortcode'));
     add_shortcode('bt-toggles', array($this, 'toggles_shortcode'));
     add_shortcode('bt-toggle', array($this, 'toggle_shortcode'));
     add_shortcode('bt-alert', array($this, 'alert_shortcode'));
     add_shortcode('bt-button', array($this, 'button_shortcode'));
     add_shortcode('bt-icon', array($this, 'icon_shortcode'));
     if (function_exists('shortcode_exists') && !shortcode_exists('entry-published')) {
         add_shortcode('entry-published', array($this, 'entry_published_shortcode'));
     }
     if (function_exists('shortcode_exists') && !shortcode_exists('entry-author')) {
         add_shortcode('entry-author', array($this, 'entry_author_shortcode'));
     }
 }
Пример #29
0
/**
 * Load and enqueue front end scripts and stylesheets
 */
function epl_wp_enqueue_scripts()
{
    global $epl_settings;
    $epl_default_view_type = isset($epl_settings['display_archive_view_type']) ? $epl_settings['display_archive_view_type'] : 'list';
    $current_dir_path = plugins_url('', __FILE__);
    wp_register_script('epl-front-scripts', $current_dir_path . '/js/jquery-front-scripts.js', array('jquery'), EPL_PROPERTY_VER);
    if (is_epl_post() && shortcode_exists('listing_map')) {
        wp_enqueue_script('google-map-v-3', 'https://maps.googleapis.com/maps/api/js?v=3.exp');
    }
    if (isset($epl_settings['epl_use_core_css']) && $epl_settings['epl_use_core_css'] == 'on') {
    } else {
        wp_enqueue_style('epl-front-styles', $current_dir_path . '/css/style-front.css', FALSE, EPL_PROPERTY_VER);
        wp_enqueue_style('epl-css-lib', $current_dir_path . '/css/epl.css', FALSE, EPL_PROPERTY_VER);
    }
    $js_vars = array('epl_default_view_type' => $epl_default_view_type, 'ajaxurl' => admin_url('admin-ajax.php'));
    wp_enqueue_script('epl-js-lib', $current_dir_path . '/js/epl.js', array('jquery'), EPL_PROPERTY_VER);
    wp_localize_script('epl-front-scripts', 'epl_frontend_vars', $js_vars);
    wp_enqueue_script('epl-front-scripts');
}
Пример #30
0
 public function load()
 {
     add_action('podlove_dashboard_meta_boxes', array($this, 'register_meta_boxes'));
     add_filter('the_content', array($this, 'autoinsert_into_content'));
     add_action('wp', array($this, 'standalone_player_page'));
     // backward compatible, but only load if no other plugin has registered this shortcode
     if (!shortcode_exists('podlove-web-player')) {
         add_shortcode('podlove-web-player', [__CLASS__, 'shortcode']);
     }
     add_shortcode('podlove-episode-web-player', [__CLASS__, 'shortcode']);
     if (!defined('PODLOVE_MEDIA_PLAYER')) {
         if (defined('PODLOVEWEBPLAYER_DIR')) {
             define('PODLOVE_MEDIA_PLAYER', 'external');
             return;
         } else {
             define('PODLOVE_MEDIA_PLAYER', 'internal');
         }
     }
     include_once 'player/podlove-web-player/podlove-web-player.php';
 }