• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP shortcode_unautop函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中shortcode_unautop函数的典型用法代码示例。如果您正苦于以下问题:PHP shortcode_unautop函数的具体用法?PHP shortcode_unautop怎么用?PHP shortcode_unautop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了shortcode_unautop函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: onContentPrepare

 public function onContentPrepare($context, &$article, &$params, $limitstart)
 {
     if (!JFactory::getApplication()->isAdmin()) {
         JHtml::_('jquery.framework');
         $document = JFactory::getDocument();
         $type = $document->getType();
         if ($type == 'html') {
             $currentHeadData = $document->getHeadData();
             $path = JPATH_PLUGINS . str_replace("plugins", "", strstr(realpath(dirname(__FILE__)), 'plugins'));
             require_once 'core/shortcode_include.php';
             importShortCodeFiles($path);
             $data = do_shortcode(shortcode_unautop($article->text));
             $newHeadData = $document->getHeadData();
             $scripts = (array) array_diff_key($currentHeadData['scripts'], $newHeadData['scripts']);
             $styles = (array) array_diff_key($currentHeadData['styleSheets'], $newHeadData['styleSheets']);
             $finalHeadData = '';
             foreach ($scripts as $key => $type) {
                 $document->addScript($key);
             }
             foreach ($styles as $key => $type) {
                 $document->addStyleSheet($key);
             }
             $article->text = $data;
         }
     }
 }
开发者ID:Andrey81,项目名称:SpoilerAlert,代码行数:26,代码来源:plg_spoileralert.php


示例2: st_remove_wpautop

 function st_remove_wpautop($content)
 {
     if (function_exists('wpb_js_remove_wpautop')) {
         $content = wpautop(preg_replace('/<\\/?p\\>/', "\n", $content) . "\n");
         return do_shortcode(shortcode_unautop($content));
     }
 }
开发者ID:DaddyFool,项目名称:travelTest,代码行数:7,代码来源:class.sthelper.php


示例3: ts_our_clients_func

function ts_our_clients_func($atts, $content = null)
{
    extract(shortcode_atts(array('header' => ''), $atts));
    $rand = rand(15000, 50000);
    return '
			<section class="widget widget_our_clients">
				<h2 class="title">' . $header . '</h2>
				<div class="separator"><div></div></div>
				<div class="pagination"></div>
				<div class="grid_12">
					<div class="widget_our_clients-container flexslider clearfix" id="flexslider-' . $rand . '">
						<ul class="slides">
							' . do_shortcode(shortcode_unautop($content)) . '
						</ul>
					</div>
				</div>
			</section>
		<script type="text/javascript">// <![CDATA[
			jQuery(document).ready(function() {
				jQuery("#flexslider-' . $rand . '").flexslider({
					animation: "slide",
					controlNav: false,
					directionNav: true,
					itemWidth: 200,
					itemMargin: 0,
					minItems: 1,
					maxItems: 5,
					move:1
				});
			});
			// ]]>
		</script>';
}
开发者ID:Jwiens92,项目名称:CumberLandSpice,代码行数:33,代码来源:our_clients.php


示例4: wpmtst_the_content

/**
 * Display the testimonial content.
 *
 * @param null $length
 *
 * @since 1.24.0
 * @since 2.4.0 Run content through selected filters only, instead
 *              of all filters added to the_excerpt() or the_content().
 *
 * @todo Use native auto-excerpt and trim_words instead.
 */
function wpmtst_the_content($length = null)
{
    if ($length) {
        $excerpt = false;
    } else {
        $excerpt = WPMST()->atts('excerpt');
        $length = WPMST()->atts('length');
    }
    // In View settings, {excerpt} overrides {length} overrides {full content}.
    if ($excerpt) {
        $content = get_the_excerpt();
        $content = apply_filters('the_excerpt', $content);
    } else {
        if ($length) {
            $content = wpmtst_get_field('truncated', array('char_limit' => $length));
        } else {
            $content = get_the_content();
        }
        // Applying all content filters breaks POS NextGEN Gallery.
        // So need to find a way to select which additional filters, if any, to apply.
        // For instance, All In One Rich Snippets.
        //$content = apply_filters( 'the_content', $content );
        $content = wptexturize($content);
        $content = convert_smilies($content);
        $content = wpautop($content);
        $content = shortcode_unautop($content);
        $content = do_shortcode($content);
    }
    echo $content;
}
开发者ID:serker72,项目名称:T3S,代码行数:41,代码来源:template-functions.php


示例5: shortcode_item

 public function shortcode_item($atts, $content = null)
 {
     $attributes = shortcode_atts(array('title' => ''), $atts);
     $attributes['title'] = wp_kses($attributes['title'], array());
     $output = sprintf('<li><a class="text-primary" href="#">%s</a><div class="st-content">%s</div></li>', $attributes['title'], do_shortcode(shortcode_unautop(wpautop($content))));
     return $output;
 }
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:7,代码来源:accordion.php


示例6: remove_wpautop

function remove_wpautop($content)
{
    $content = do_shortcode(shortcode_unautop($content));
    $new_content = preg_replace('#^<\\/p>|^<br \\/>|<p>$#', '', $content);
    $new_content = str_replace('<br />', "", $new_content);
    return $new_content;
}
开发者ID:jgeletka,项目名称:simskin,代码行数:7,代码来源:sub-functions.php


示例7: contentAdmin

 public function contentAdmin($atts, $content = null)
 {
     /**
      * @var string @el_class - comes
      */
     extract(shortcode_atts($this->predefined_atts, $atts));
     $output = '';
     $column_controls = $this->getControls($this->settings('controls'));
     $output .= '<div ' . $this->mainHtmlBlockParams('12', '') . '>';
     $output .= $column_controls;
     $output .= '<div ' . $this->containerHtmlBlockParams('12', '') . '>';
     $output .= $this->itemGrid();
     $output .= do_shortcode(shortcode_unautop($content));
     $output .= '</div>';
     if (isset($this->settings['params'])) {
         $inner = '';
         foreach ($this->settings['params'] as $param) {
             $param_value = isset(${$param}['param_name']) ? ${$param}['param_name'] : '';
             if (is_array($param_value)) {
                 // Get first element from the array
                 reset($param_value);
                 $first_key = key($param_value);
                 $param_value = $param_value[$first_key];
             }
             $inner .= $this->singleParamHtmlHolder($param, $param_value);
         }
         $output .= $inner;
     }
     $output .= '</div>';
     $output .= '</div>';
     return $output;
 }
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:32,代码来源:vc-gitem.php


示例8: contentHelper

 protected static function contentHelper($content, $pre = 'c')
 {
     if (strpos($content, '[_') !== false) {
         $content = preg_replace('@(\\[_*)_(' . $pre . '|/)@', "\$1\$2", $content);
     }
     return do_shortcode(shortcode_unautop($content));
 }
开发者ID:NuWebMarketing,项目名称:PurgatoryMedia,代码行数:7,代码来源:Shortcode.php


示例9: bic_rm_wpautop

 function bic_rm_wpautop($content)
 {
     $content = do_shortcode(shortcode_unautop($content));
     $content = preg_replace('#^<\\/p>|^<br \\/>|<p>$#', '', $content);
     //$content = str_replace("</p>", "<br />", $content);
     return $content;
 }
开发者ID:andydunkel,项目名称:TwitterBootstrap3BlankTheme,代码行数:7,代码来源:shortcodes.php


示例10: lpd_js_remove_wpautop

function lpd_js_remove_wpautop($content, $autop = false)
{
    if ($autop) {
        $content = wpautop(preg_replace('/<\\/?p\\>/', "\n", $content) . "\n");
    }
    return do_shortcode(shortcode_unautop($content));
}
开发者ID:ksan5835,项目名称:maadithottam,代码行数:7,代码来源:Functions.php


示例11: wpsight_format_content

 function wpsight_format_content($content)
 {
     if (!$content) {
         return;
     }
     $content = do_shortcode(shortcode_unautop(wpautop(convert_chars(convert_smilies(wptexturize($content))))));
     return apply_filters('wpsight_format_content', $content);
 }
开发者ID:phucanh92,项目名称:vietlong,代码行数:8,代码来源:helpers.php


示例12: elite_animation_right

function elite_animation_right($atts, $content = null)
{
    $content = do_shortcode($content);
    // Allow other shortcodes inside the column content.
    if (false !== strpos($content, '[')) {
        $content = do_shortcode(shortcode_unautop($content));
    }
    return sprintf('<div class="cbp-so-side cbp-so-side-right">%s</div>', $content);
}
开发者ID:Ezyva2015,项目名称:money101.com.au,代码行数:9,代码来源:shortcodes.php


示例13: seed_ucp_description

function seed_ucp_description()
{
    $o = seed_ucp_get_settings();
    extract($o);
    $output = '';
    if (!empty($description)) {
        $output .= '<div id="seed-ucp-description">' . shortcode_unautop(wpautop(convert_chars(wptexturize($description)))) . '</div>';
    }
    return $output;
}
开发者ID:taeche,项目名称:SoDoEx,代码行数:10,代码来源:functions.php


示例14: filterResults

 /**
  * Properly parse content to detect images/text keywords.
  * @since 4.4
  *
  * @param $content
  *
  * @return string
  */
 public function filterResults($content)
 {
     /**
      * @since 4.4.3
      * vc_filter: vc_vendor_yoastseo_filter_results
      */
     do_action('vc_vendor_yoastseo_filter_results');
     $content = do_shortcode(shortcode_unautop($content));
     return $content;
 }
开发者ID:walkthenight,项目名称:walkthenight-wordpress,代码行数:18,代码来源:class-vc-vendor-yoast_seo.php


示例15: render

    protected function render()
    {
        $shortcode = $this->get_settings('shortcode');
        $shortcode = do_shortcode(shortcode_unautop($shortcode));
        ?>
		<div class="elementor-shortcode"><?php 
        echo $shortcode;
        ?>
</div>
		<?php 
    }
开发者ID:pojome,项目名称:elementor,代码行数:11,代码来源:shortcode.php


示例16: return_clean

/**
 * Helper function for removing automatic p and br tags from nested short codes
 */
function return_clean($content, $p_tag = false, $br_tag = false)
{
    $content = preg_replace('#^<\\/p>|^<br \\/>|<p>$#', '', $content);
    if ($br_tag) {
        $content = preg_replace('#<br \\/>#', '', $content);
    }
    if ($p_tag) {
        $content = preg_replace('#<p>|</p>#', '', $content);
    }
    return do_shortcode(shortcode_unautop(trim($content)));
}
开发者ID:sptheme,项目名称:discover-travel,代码行数:14,代码来源:shortcodes-functions.php


示例17: labels

function labels($atts = null, $content = null)
{
    extract(shortcode_atts(array('type' => ''), $atts));
    $content = do_shortcode(shortcode_unautop($content));
    if ($type == 'heading') {
        $out = '<span class="labelHeading">' . $content . '</span>';
        return $out;
    } else {
        return $content;
    }
}
开发者ID:Hobbygaze,项目名称:wp,代码行数:11,代码来源:customShortcodes.php


示例18: get_child_elements_data

 /**
  * Convert a Visual Composer nested child element data into an array
  * @param string $child_shortcode_content the nested child elements shortcodes
  * @return array
  */
 static function get_child_elements_data($child_shortcode_content)
 {
     // Convert the shortcode to the actual content
     $content = do_shortcode(shortcode_unautop($child_shortcode_content));
     $json_array = explode(PHP_EOL, $content);
     // Remove the first element of the json_array since it will be always empty
     array_shift($json_array);
     // Create a valid JSON
     $json = '[' . implode(',', $json_array) . ']';
     // return an associative array or the data
     return json_decode($json, true);
 }
开发者ID:proteusthemes,项目名称:visual-composer-elements,代码行数:17,代码来源:class-vc-helpers.php


示例19: dh_tooltip_shortcode

 public function dh_tooltip_shortcode($atts, $content = null)
 {
     $tooltip = '';
     extract(shortcode_atts(array('text' => '', 'url' => '#', 'type' => '', 'position' => '', 'title' => '', 'trigger' => ''), $atts));
     $data_el = '';
     if (!empty($type)) {
         $data_el = ' data-toggle="' . $type . '" data-container="body" data-original-title="' . ($type === 'tooltip' ? esc_attr(do_shortcode(shortcode_unautop($content))) : esc_attr($title)) . '" data-trigger="' . $trigger . '" data-placement="' . $position . '" ' . ($type === 'popover' ? ' data-content="' . esc_attr(do_shortcode(shortcode_unautop($content))) . '"' : '') . '';
     }
     if (!empty($data_el)) {
         $tooltip = '<a' . $data_el . ' href="' . esc_url($url) . '">' . do_shortcode(shortcode_unautop($text)) . '</a>';
     }
     return $tooltip;
 }
开发者ID:jonasbelcina,项目名称:platinumdxb,代码行数:13,代码来源:init.php


示例20: mb_shortcode_unautop

/**
 * Content filter for only "un-auto-p'ing" allowed shortcodes.  This is a wrapper for `shortcode_unautop()`.
 *
 * @since  1.0.0
 * @access public
 * @param  string  $content
 * @return string
 */
function mb_shortcode_unautop($content)
{
    global $shortcode_tags;
    $temp = $shortcode_tags;
    foreach ($shortcode_tags as $tag => $func) {
        if (!in_array($tag, mb_get_allowed_shortcodes())) {
            remove_shortcode($tag);
        }
    }
    $content = shortcode_unautop($content);
    $shortcode_tags = $temp;
    return $content;
}
开发者ID:justintadlock,项目名称:message-board,代码行数:21,代码来源:shortcodes.php



注:本文中的shortcode_unautop函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP shortcut_current_displayed_set函数代码示例发布时间:2022-05-24
下一篇:
PHP shortcode_ui_register_for_shortcode函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap