本文整理匯總了PHP中shortcode_unautop函數的典型用法代碼示例。如果您正苦於以下問題:PHP shortcode_unautop函數的具體用法?PHP shortcode_unautop怎麽用?PHP shortcode_unautop使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了shortcode_unautop函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
}
}
示例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));
}
}
示例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>';
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
示例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;
}
示例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));
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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
}