当前位置: 首页>>代码示例>>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;未经允许,请勿转载。