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


PHP remove_shortcode函數代碼示例

本文整理匯總了PHP中remove_shortcode函數的典型用法代碼示例。如果您正苦於以下問題:PHP remove_shortcode函數的具體用法?PHP remove_shortcode怎麽用?PHP remove_shortcode使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: remove

 public function remove()
 {
     if (!empty($this->p->options['plugin_shortcodes'])) {
         remove_shortcode($this->shortcode_tag);
         $this->p->debug->log('[' . $this->shortcode_tag . '] sharing shortcode removed');
     }
 }
開發者ID:kivivuori,項目名稱:jotain,代碼行數:7,代碼來源:sharing.php

示例2: wpse_74735_replace_wp_caption_shortcode

 /**
  * Replace the default caption shortcode handler.
  *
  * @return void
  */
 static function wpse_74735_replace_wp_caption_shortcode()
 {
     remove_shortcode('caption', 'img_caption_shortcode');
     remove_shortcode('wp_caption', 'img_caption_shortcode');
     add_shortcode('caption', array('Bw_setup', 'wpse_74735_caption_shortcode'));
     add_shortcode('wp_caption', array('Bw_setup', 'wpse_74735_caption_shortcode'));
 }
開發者ID:damiansu,項目名稱:wordpress-es,代碼行數:12,代碼來源:Bw_setup.php

示例3: icp_post_page_hook

function icp_post_page_hook($content)
{
    global $post;
    if (trim(icp_get_option('icp_global_carousel_active')) != 'active') {
        if (trim(get_post_meta($post->ID, 'icp_meta_options', true)) != 'no') {
            if (has_filter('icp_frontend_filter')) {
                apply_filters('icp_frontend_filter', '');
            }
            //deactivate WordPress function
            remove_shortcode('gallery', 'gallery_shortcode');
            //activate own function
            add_shortcode('gallery', 'icp_gallery_shortcode');
            //add_action( 'print_footer_scripts', 'icp_frontend_wp_footer' );
            wp_enqueue_script('icp-carousel');
            wp_enqueue_script('icp-easing');
            //wp_enqueue_script( 'icp-lazyload' ); BETA
            wp_enqueue_style('icp-carousel-style');
            wp_enqueue_style('icp-carousel-theme');
            //add_filter( 'wp_get_attachment_image_attributes', 'icp_bfi_thumb_lazyload'); // Lazyload only ( BETA )
            add_filter('wp_get_attachment_image_attributes', 'icp_bfi_thumb');
            // bfi_thumb
            if (trim(icp_get_option('icp_carousel_adapt_height')) == 'false') {
                add_filter('wp_calculate_image_srcset_meta', '__return_null');
            }
        }
    }
    return $content;
}
開發者ID:paulcherrypipka,項目名稱:wptest,代碼行數:28,代碼來源:icp-functions.php

示例4: affiliates_landing

 public static function affiliates_landing($attr = array(), $content = null)
 {
     global $wpdb;
     remove_shortcode('affiliates_landing');
     $content = do_shortcode($content);
     add_shortcode('affiliates_landing', array(__CLASS__, 'affiliates_landing'));
     $output = "";
     if (strlen($content) > 0) {
         $base_url = trim($content);
         $base_url = str_replace('&', '&', $base_url);
         $base_url = strip_tags($base_url);
         $base_url = preg_replace('/\\r|\\n/', '', $base_url);
         $base_url = trim($base_url);
     }
     if (!class_exists("Affiliates_Service")) {
         require_once AFFILIATES_CORE_LIB . '/class-affiliates-service.php';
     }
     if (isset($_GET[get_option('aff_pname', AFFILIATES_PNAME)])) {
         $affiliate_id = $_GET[get_option('aff_pname', AFFILIATES_PNAME)];
     } else {
         if (isset($_POST[get_option('aff_pname', AFFILIATES_PNAME)])) {
             $affiliate_id = $_POST[get_option('aff_pname', AFFILIATES_PNAME)];
         } else {
             $affiliate_id = Affiliates_Service::get_referrer_id();
         }
     }
     $output .= affiliates_get_affiliate_url($base_url, $affiliate_id);
     return $output;
 }
開發者ID:eggemplo,項目名稱:Affiliates-landing,代碼行數:29,代碼來源:affiliates-landing.php

示例5: setup_gallery_shortcode

 /**
  * Create a gallery shortcode.
  *
  * @since 1.0
  */
 public function setup_gallery_shortcode()
 {
     remove_shortcode('gallery', array($this, 'gallery_shortcode'));
     // First remove the standard wordpress gallery shortcode action.
     add_shortcode('gallery', array($this, 'foundation_gallery_shortcode'));
     // Add our foundation clearing gallery shortcode action here.
 }
開發者ID:benlaud,項目名稱:hatch,代碼行數:12,代碼來源:foundation-clearing.php

示例6: attach_to_hooks

 public function attach_to_hooks()
 {
     if (isset($GLOBALS['VipersVideoQuicktags'])) {
         remove_shortcode('youtube');
         add_shortcode('youtube', array($this, 'shortcode_youtube'));
         remove_shortcode('vimeo');
         add_shortcode('vimeo', array($this, 'shortcode_vimeo'));
         remove_shortcode('quicktime');
         remove_shortcode('flash');
         remove_shortcode('videofile');
         remove_shortcode('video');
         remove_shortcode('avi');
         remove_shortcode('mpeg');
         remove_shortcode('wmv');
         add_shortcode('quicktime', array($this, 'shortcode_viper_generic'));
         add_shortcode('flash', array($this, 'shortcode_viper_generic'));
         add_shortcode('videofile', array($this, 'shortcode_viper_generic'));
         add_shortcode('video', array($this, 'shortcode_viper_generic'));
         add_shortcode('avi', array($this, 'shortcode_viper_generic'));
         add_shortcode('mpeg', array($this, 'shortcode_viper_generic'));
         add_shortcode('wmv', array($this, 'shortcode_viper_generic'));
     }
     remove_action('shoutem_get_post_start', array($this, 'on_shoutem_post_start'));
     add_action('shoutem_get_post_start', array($this, 'on_shoutem_post_start'));
 }
開發者ID:gopinathshiva,項目名稱:wordpress-vip-plugins,代碼行數:25,代碼來源:class-shoutem-viper-dao.php

示例7: remove

 public function remove()
 {
     if (!empty($this->p->options['plugin_shortcodes'])) {
         remove_shortcode(NGFB_SHARING_SHORTCODE);
         $this->p->debug->log('[' . NGFB_SHARING_SHORTCODE . '] sharing shortcode removed');
     }
 }
開發者ID:christocmp,項目名稱:bingopaws,代碼行數:7,代碼來源:sharing.php

示例8: filter_select

 function filter_select()
 {
     $simplemasonry_apply = get_post_meta(get_the_ID(), 'simplemasonry_apply');
     if (!empty($simplemasonry_apply) && $simplemasonry_apply[0] === 'true') {
         $pattern_gallerylink = '/\\[' . preg_quote('gallerylink') . '[^\\]]*\\]/im';
         $pattern_medialink = '/\\[' . preg_quote('medialink') . '[^\\]]*\\]/im';
         $post_text = get_post(get_the_ID());
         if (!empty($post_text->post_content)) {
             $contents = $post_text->post_content;
         }
         if (!empty($contents) && preg_match($pattern_gallerylink, $contents)) {
             // for GalleryLink http://wordpress.org/plugins/gallerylink/
             add_filter('album_gallerylink', array($this, 'add_img_tag'), 17);
             add_filter('album_gallerylink', array($this, 'add_div_tag'), 18);
         } else {
             if (!empty($contents) && preg_match($pattern_medialink, $contents)) {
                 // for MediaLink http://wordpress.org/plugins/medialink/
                 add_filter('album_medialink', array($this, 'add_img_tag'), 17);
                 add_filter('album_medialink', array($this, 'add_div_tag'), 18);
             } else {
                 // for post or page
                 add_filter('the_content', array($this, 'add_img_tag'), 9);
                 remove_shortcode('gallery', 'gallery_shortcode');
                 add_shortcode('gallery', array($this, 'simplemasonry_gallery_shortcode'));
                 add_filter('the_content', array($this, 'add_div_tag'), 16);
             }
         }
     }
 }
開發者ID:juju921,項目名稱:elodiewordpress,代碼行數:29,代碼來源:SimpleMasonry.php

示例9: initialise_shortcode_listener

 public function initialise_shortcode_listener()
 {
     //remove shortcode listener
     remove_shortcode($this->shortcode);
     //add shortcode listener
     add_shortcode($this->shortcode, array(&$this, 'use_shortcode'));
 }
開發者ID:virendrayadav,項目名稱:bigperlus,代碼行數:7,代碼來源:shortcode.class.php

示例10: get_post_by

 /**
  * Get a post by a specified field and value
  *
  * @param string $field
  * @param string $field_value
  * @param string $context Post use context (e.g. 'display')
  * @return array Post
  **/
 function get_post_by($field, $field_value, $context = 'display')
 {
     // validate input
     if (!in_array($field, array('ID', 'name'))) {
         return new WP_Error('invalid_field', 'Invalid API FIELD', 400);
     }
     if (!in_array($context, array('display', 'edit'))) {
         return new WP_Error('invalid_context', 'Invalid API CONTEXT', 400);
     }
     if ('display' === $context) {
         $args = $this->query_args();
         if (isset($args['content_width']) && $args['content_width']) {
             $GLOBALS['content_width'] = (int) $args['content_width'];
         }
     }
     if (strpos($_SERVER['HTTP_USER_AGENT'], 'wp-windows8')) {
         remove_shortcode('gallery', 'gallery_shortcode');
         add_shortcode('gallery', array(&$this, 'win8_gallery_shortcode'));
     }
     // fetch SAL post
     $post = $this->get_sal_post_by($field, $field_value, $context);
     if (is_wp_error($post)) {
         return $post;
     }
     $GLOBALS['post'] = $post;
     // TODO: not sure where this one should go
     if ('display' === $context) {
         setup_postdata($post);
     }
     $response = $this->render_response_keys($post, $context, array_keys($this->post_object_format));
     unset($GLOBALS['post']);
     return $response;
 }
開發者ID:egill,項目名稱:jetpack,代碼行數:41,代碼來源:class.wpcom-json-api-post-v1-1-endpoint.php

示例11: xtreme_init_gallery

function xtreme_init_gallery()
{
    $start_xtreme_gallery = apply_filters('use_xtreme_gallery', FALSE);
    if ($start_xtreme_gallery) {
        remove_shortcode('gallery', 'gallery_shortcode');
        add_shortcode('gallery', 'xtreme_gallery_shortcode');
    }
}
開發者ID:katikos,項目名稱:xtreme-one,代碼行數:8,代碼來源:xtreme-image-functions.php

示例12: override_download_shortcode

function override_download_shortcode()
{
    include_once ABSPATH . 'wp-admin/includes/plugin.php';
    if (is_plugin_active('download-manager/download-manager.php')) {
        remove_shortcode('wpdm_file');
        add_shortcode('wpdm_file', 'new_wpdm_downloadable_nsc');
    }
}
開發者ID:amit0773,項目名稱:manaslake,代碼行數:8,代碼來源:functions.php

示例13: unregister

 /**
  * Unregisters the list of shortcodes in Wordpress.
  * @return null
  */
 public function unregister()
 {
     if ($this->hasShortcodes()) {
         foreach ($this->shortcodes as $shortcode => $methodName) {
             remove_shortcode($this->formatCode($shortcode));
         }
     }
 }
開發者ID:francoisfaubert,項目名稱:strata,代碼行數:12,代碼來源:ShortcodeLoader.php

示例14: jobman_remove_shortcodes

function jobman_remove_shortcodes($array)
{
    foreach ((array) $array as $shortcode) {
        $conditional = 'if_' . $shortcode;
        remove_shortcode($shortcode);
        remove_shortcode($conditional);
    }
}
開發者ID:pduobert,項目名稱:wordpress-job-manager,代碼行數:8,代碼來源:frontend-shortcodes.php

示例15: remove_embed

 function remove_embed()
 {
     global $wp_embed;
     remove_filter('the_content', array($wp_embed, 'run_shortcode'), 8);
     // remove the embed shortcode since we would do the part later.
     remove_shortcode('embed');
     // Attempts to embed all URLs in a post
     remove_filter('the_content', array($wp_embed, 'autoembed'), 8);
 }
開發者ID:iamtakashi,項目名稱:jetpack,代碼行數:9,代碼來源:class.jetpack-sync-module-posts.php


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