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

PHP force_balance_tags函数代码示例

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

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



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

示例1: from_html

 public static function from_html($html, $title)
 {
     // give us soem breathing room
     ini_set('max_execution_time', 180);
     //$ohtml = $html;
     // pre-parse remote or url based assets
     try {
         $html = self::_pre_parse_remote_assets($html);
     } catch (Exception $e) {
         die('error');
         echo '<h1>Problem parsing html.</h1>';
         echo '<h2>' . force_balance_tags($e->getMessage()) . '</h2>';
         return;
     }
     // if we are debugging the pdf, then depending on the mode, dump the html contents onw
     if (QSOT_DEBUG_PDF & 2) {
         // || ( current_user_can( 'edit_posts' ) && isset( $_GET['as'] ) && 'html' == $_GET['as'] ) ) {
         echo '<pre>';
         echo htmlspecialchars($html);
         echo '</pre>';
         die;
     }
     // include the library
     require_once QSOT::plugin_dir() . 'libs/dompdf/dompdf_config.inc.php';
     // make and output the pdf
     $pdf = new DOMPDF();
     $pdf->load_html($html);
     $pdf->render();
     $pdf->stream(sanitize_title_with_dashes('ticket-' . $title) . '.pdf', array('Attachment' => 1));
     exit;
 }
开发者ID:Jayriq,项目名称:opentickets-community,代码行数:31,代码来源:pdf.class.php


示例2: dnp_social

/**
* Social Shorcodes
*/
function dnp_social($params, $content = null)
{
    extract(shortcode_atts(array('type' => 'facebook', 'link' => '#'), $params));
    $content = preg_replace('/<br class="nc".\\/>/', '', $content);
    $result = '<a class="social ' . $type . '" href="' . $link . '"><i class="icon-' . ($type !== 'gplus' ? $type : 'google-plus') . '"></i></a>';
    return force_balance_tags($result);
}
开发者ID:samuel657677,项目名称:www.mertex.de,代码行数:10,代码来源:dnp_social.php


示例3: bs_buttons

function bs_buttons($params, $content = null)
{
    extract(shortcode_atts(array('size' => 'default', 'type' => 'default', 'value' => 'button', 'href' => "#"), $params));
    $content = preg_replace('/<br class="nc".\\/>/', '', $content);
    $result = '<a class="btn btn-' . $size . ' btn-' . $type . '" href="' . $href . '">' . $value . '</a>';
    return force_balance_tags($result);
}
开发者ID:t3patterson,项目名称:bootstrap_to_wp,代码行数:7,代码来源:bs_buttons.php


示例4: xprofile_sanitize_data_value_before_save

/**
 * xprofile_sanitize_data_value_before_save ( $field_value, $field_id )
 *
 * Safely runs profile field data through kses and force_balance_tags.
 *
 * @param string $field_value
 * @param int $field_id
 * @return string
 */
function xprofile_sanitize_data_value_before_save ( $field_value, $field_id ) {

	// Return if empty
	if ( empty( $field_value ) )
		return;

	// Value might be serialized
	$field_value = maybe_unserialize( $field_value );

	// Filter single value
	if ( !is_array( $field_value ) ) {
		$kses_field_value     = wp_filter_kses( $field_value );
		$filtered_field_value = force_balance_tags( $kses_field_value );

	// Filter each array item independently
	} else {
		foreach ( (array)$field_value as $value ) {
			$kses_field_value       = wp_filter_kses( $value );
			$filtered_values[] = force_balance_tags( $kses_field_value );
		}

		$filtered_field_value = serialize( $filtered_values );
	}

	return $filtered_field_value;
}
开发者ID:n-sane,项目名称:zaroka,代码行数:35,代码来源:bp-xprofile-filters.php


示例5: dnp_contact

function dnp_contact($params, $content = null)
{
    extract(shortcode_atts(array(), $params));
    $content = preg_replace('/<br class="nc".\\/>/', '', $content);
    $result = '';
    $result .= '<form class="comment_form" id="commentform" method="post" action="' . admin_url('admin-ajax.php?action=contact') . '">
						<div class="row-fluid">
							<div class="span6">
								<input type="email" placeholder="' . __('Email', '') . '" required name="email" id="email">
							</div>
							<div class="span6">
								<input type="text" placeholder="' . __('Name', '') . '" required name="name" id="name">
							</div>
						</div>
						<div class="row-fluid">
							<div class="span8">
								<textarea rows="10" cols="30" placeholder="' . __('Message', '') . '" name="message"></textarea>
							</div>
							<div class="span4">
								<button type="submit" class="btn "><i class="li_paperplane"></i>' . __('Send message', 'argo') . '</button>
							</div>
						</div>
					</form>';
    return force_balance_tags($result);
}
开发者ID:samuel657677,项目名称:www.mertex.de,代码行数:25,代码来源:dnp_contact.php


示例6: dws_icons

/**
 * Button
 */
function dws_icons($params, $content = null)
{
    extract(shortcode_atts(array('name' => 'default'), $params));
    $content = preg_replace('/<br class="nc".\\/>/', '', $content);
    $result = '<i class="' . $name . '"></i>';
    return force_balance_tags($result);
}
开发者ID:rinodung,项目名称:live-theme,代码行数:10,代码来源:dws_icons.php


示例7: erh_trim_excerpt

 function erh_trim_excerpt($text)
 {
     $raw_excerpt = $text;
     if ('' == $text) {
         $text = get_the_content('');
         $text = strip_shortcodes($text);
         $text = apply_filters('the_content', $text);
         // $text = str_replace(']]>', ']]>', $text);
         //  $text = strip_tags($text, '<em><strong><p>');
         // Set the excerpt length
         $excerpt_length = apply_filters('excerpt_length', 150);
         // Set what appears at the end of the excerpt
         $excerpt_more = apply_filters('excerpt_more', ' ' . '...');
         $words = preg_split("/[\n\r\t ]+/", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY);
         if (count($words) > $excerpt_length) {
             array_pop($words);
             $text = implode(' ', $words);
             $text = $text . $excerpt_more;
             $text = force_balance_tags($text);
         } else {
             $text = implode(' ', $words);
         }
     }
     return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
 }
开发者ID:ehermanson,项目名称:wp-starter-bootstrap,代码行数:25,代码来源:posts.php


示例8: removeEmptyPTag

 /**
  * Removes empty p-tags
  * @param  string $content Text
  * @return string       Markup
  */
 public function removeEmptyPTag($content)
 {
     $content = force_balance_tags($content);
     $content = preg_replace('#<p>\\s*+(<br\\s*/*>)?\\s*</p>#i', '', $content);
     $content = preg_replace('~\\s?<p>(\\s|&nbsp;)+</p>\\s?~', '', $content);
     return $content;
 }
开发者ID:helsingborg-stad,项目名称:Municipio,代码行数:12,代码来源:General.php


示例9: els_heading

function els_heading($params, $content = null)
{
    extract(shortcode_atts(array('size' => 'h2', 'text' => 'Heading 2 Custom'), $params));
    $content = preg_replace('/<br class="nc".\\/>/', '', $content);
    $result = sprintf('<%1$s class="els-heading"><span class="sr">%2$s</span></%1$s>', $size, $text);
    return force_balance_tags($result);
}
开发者ID:anup04sust,项目名称:GarnetMachine,代码行数:7,代码来源:els_heading.php


示例10: els_labels

function els_labels($params, $content = null)
{
    extract(shortcode_atts(array('type' => 'default'), $params));
    $content = preg_replace('/<br class="nc".\\/>/', '', $content);
    $result = '<span class="label label-' . $type . '">' . $content . '</span>';
    return force_balance_tags($result);
}
开发者ID:anup04sust,项目名称:GarnetMachine,代码行数:7,代码来源:els_labels.php


示例11: dnp_code_inline

function dnp_code_inline($params, $content = null)
{
    extract(shortcode_atts(array('type' => '', 'value' => ''), $params));
    $content = preg_replace('/<br class="nc".\\/>/', '', $content);
    $result = '<code>' . do_shortcode($content) . '</code>';
    return force_balance_tags($result);
}
开发者ID:samuel657677,项目名称:www.mertex.de,代码行数:7,代码来源:dnp_code.php


示例12: dnp_buttons_toolbar

function dnp_buttons_toolbar($params, $content = null)
{
    extract(shortcode_atts(array(), $params));
    $content = preg_replace('/<br class="nc".\\/>/', '', $content);
    $result = '<div class="btn-toolbar">' . do_shortcode($content) . '</div>';
    return force_balance_tags($result);
}
开发者ID:samuel657677,项目名称:www.mertex.de,代码行数:7,代码来源:dnp_buttons.php


示例13: my_shortcode_panel

function my_shortcode_panel($atts, $content = null)
{
    // extract and set defaults
    extract(shortcode_atts(array('type' => 'keyline'), $atts));
    $output_string = '<article class="island panel ' . $type . '">' . $content . '</article>';
    return force_balance_tags($output_string);
}
开发者ID:xeyefex,项目名称:Mixd-WordPress-Framework,代码行数:7,代码来源:shortcodes.php


示例14: xprofile_sanitize_data_value_before_save

/**
 * xprofile_sanitize_data_value_before_save ( $field_value, $field_id )
 *
 * Safely runs profile field data through kses and force_balance_tags.
 *
 * @param string $field_value
 * @param int $field_id
 * @param bool $reserialize Whether to reserialize arrays before returning. Defaults to true
 * @return string
 */
function xprofile_sanitize_data_value_before_save($field_value, $field_id, $reserialize = true)
{
    // Return if empty
    if (empty($field_value)) {
        return;
    }
    // Value might be serialized
    $field_value = maybe_unserialize($field_value);
    // Filter single value
    if (!is_array($field_value)) {
        $kses_field_value = xprofile_filter_kses($field_value);
        $filtered_field_value = nxt_rel_nofollow(force_balance_tags($kses_field_value));
        $filtered_field_value = apply_filters('xprofile_filtered_data_value_before_save', $filtered_field_value, $field_value);
        // Filter each array item independently
    } else {
        $filtered_values = array();
        foreach ((array) $field_value as $value) {
            $kses_field_value = xprofile_filter_kses($value);
            $filtered_value = nxt_rel_nofollow(force_balance_tags($kses_field_value));
            $filtered_values[] = apply_filters('xprofile_filtered_data_value_before_save', $filtered_value, $value);
        }
        if ($reserialize) {
            $filtered_field_value = serialize($filtered_values);
        } else {
            $filtered_field_value = $filtered_values;
        }
    }
    return $filtered_field_value;
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:39,代码来源:bp-xprofile-filters.php


示例15: the_excerpt_rereloaded

function the_excerpt_rereloaded($words = 40, $link_text = 'Leia Mais', $allowed_tags = '', $container = 'p', $smileys = 'no' )
{
	global $post;
        
    if ( $allowed_tags == 'all' ) $allowed_tags = '<h3>,<br>,<p>,<i>,<em>,<b>,<strong>,<ul>,<ol>,<li>,<span>,<blockquote>,<img>';
    
    $text = preg_replace('/\[.*\]/', '', strip_tags($post->post_content, $allowed_tags));

    $text = explode(' ', $text);
    $tot = count($text);
    
    for ( $i=0; $i<$words; $i++ ) : $output .= $text[$i] . ' '; endfor;
    
    if ( $smileys == "yes" ) $output = convert_smilies($output);
 
    ?><p><?php echo force_balance_tags($output) ?><?php if ( $i < $tot ) : ?> ...<?php else : ?></p><?php endif; ?>
    <?php if ( $i < $tot ) : 
        if ( $container == 'p' || $container == 'div' ) : ?></p><?php endif; 
            if ( $container != 'plain' ) : ?><<?php echo $container; ?> class="more"><?php if ( $container == 'div' ) : ?><p><?php endif; endif; ?>
            
    <a href="<?php the_permalink(); ?>" title="<?php echo $link_text; ?>"><?php echo $link_text; ?></a><?php
    
            if ( $container == 'div' ) : ?></p><?php endif; if ( $container != 'plain' ) : ?></<?php echo $container; ?>><?php endif;
        if ( $container == 'plain' || $container == 'span' ) : ?></p><?php endif; 
        endif;
        
}
开发者ID:rodolfospalenza,项目名称:blogrs,代码行数:27,代码来源:the_excerpt_rereloaded.php


示例16: dnp_thumbnails_container

function dnp_thumbnails_container($params, $content = null)
{
    extract(shortcode_atts(array('alt' => '', 'src' => ""), $params));
    $content = preg_replace('/<br class="nc".\\/>/', '', $content);
    $result = '<div class="thumbnail"> <img src="' . $src . '" alt="' . $alt . '"> <div class="caption">' . do_shortcode($content) . ' </div></div>';
    return force_balance_tags($result);
}
开发者ID:samuel657677,项目名称:www.mertex.de,代码行数:7,代码来源:dnp_thumbnails.php


示例17: dnp_images

/**
Images Shorcodes
*/
function dnp_images($params, $content = null)
{
    extract(shortcode_atts(array('alt' => '', 'class' => '', 'src' => ""), $params));
    $content = preg_replace('/<br class="nc".\\/>/', '', $content);
    $result = '<img class="image ' . $class . '" src="' . $src . '" alt="' . $alt . '" />';
    return force_balance_tags($result);
}
开发者ID:samuel657677,项目名称:www.mertex.de,代码行数:10,代码来源:dnp_images.php


示例18: custom_wp_trim_excerpt

function custom_wp_trim_excerpt($text)
{
    $raw_excerpt = $text;
    if ('' == $text) {
        //Retrieve the post content.
        $text = get_the_content('');
        $text = strip_shortcodes($text);
        $text = apply_filters('the_content', $text);
        $text = str_replace(']]&gt;', ']]&gt;', $text);
        // the code below sets the excerpt length to 55 words. You can adjust this number for your own blog.
        $excerpt_length = apply_filters('excerpt_length', 55);
        // the code below sets what appears at the end of the excerpt, in this case ...
        $excerpt_more = apply_filters('excerpt_more', ' ' . '...');
        $words = preg_split("/[\n\r\t ]+/", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY);
        if (count($words) > $excerpt_length) {
            array_pop($words);
            $text = implode(' ', $words);
            $text = force_balance_tags($text);
            $text = $text . $excerpt_more;
        } else {
            $text = implode(' ', $words);
        }
    }
    return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
}
开发者ID:austinjp,项目名称:edin-child-theme,代码行数:25,代码来源:functions.php


示例19: dnp_blockquote_author

function dnp_blockquote_author($params, $content = null)
{
    extract(shortcode_atts(array('type' => ''), $params));
    $content = preg_replace('/<br class="nc".\\/>/', '', $content);
    $result = '<small class="author">' . do_shortcode($content) . '</small>';
    return force_balance_tags($result);
}
开发者ID:samuel657677,项目名称:www.mertex.de,代码行数:7,代码来源:dnp_blockquote.php


示例20: frame

function frame($params, $content = null)
{
    extract(shortcode_atts(array('bgcolor' => 'none', 'version' => '', 'closed' => '', 'closetext' => 'Close', 'opentext' => 'Open', 'ver' => $GLOBALS['aitThemeShortcodes']['boxesFrames']), $params));
    $result = "";
    if ($bgcolor == "none") {
        $bg = '';
    } else {
        if ($ver == '1') {
            $bg = 'background: ' . $bgcolor . ';';
        } elseif ($ver == '2') {
            $bg = 'background: ' . $bgcolor . '; border-color: ' . $bgcolor . ';';
        }
    }
    if ($closed != "") {
        $cl = '<div class="frame-close closed"><span class="open text">' . $opentext . '</span><span class="close text" style="display: none;">' . $closetext . '</span></div>';
        $closedStyle = ' display: none;';
        $frameStyle = 'openable';
        $result .= "<script type='text/javascript'>\n\t\tjQuery(function() {\n\t\t\tjQuery('.frame .frame-close.closed .close.text').hide();\n\t\t\tjQuery('.frame .frame-close.closed .open.text').show();\n\t\t\t\n\t\t\tjQuery('.frame .frame-close').click(function(){\n\t\t\t\tif(jQuery(this).hasClass('closed')){\n\t\t\t\t\tvar butt = jQuery(this);\n\t\t\t\t\tjQuery(this).parent().find('.frame-wrap').slideDown('slow',function(){\n\t\t\t\t\t\tbutt.removeClass('closed');\n\t\t\t\t\t\tbutt.find('.close.text').show();\n\t\t\t\t\t\tbutt.find('.open.text').hide();\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tvar butt = jQuery(this);\n\t\t\t\t\tjQuery(this).parent().find('.frame-wrap').slideUp('slow',function(){\n\t\t\t\t\t\tbutt.addClass('closed');\n\t\t\t\t\t\tbutt.find('.close.text').hide();\n\t\t\t\t\t\tbutt.find('.open.text').show();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\t</script>";
    } else {
        $cl = '';
        $closedStyle = '';
        $frameStyle = '';
    }
    if ($ver == '1') {
        $result .= '<div class="frame ' . $version . ' ' . $frameStyle . '"' . $bg . '>' . $cl . '<div class="frame-wrap" style="' . $closedStyle . '"><div class="frame-inner">';
    } elseif ($ver == '2') {
        $result .= '<div class="frame ' . $version . ' ' . $frameStyle . '">' . $cl . '<div class="frame-wrap" style="' . $bg . $closedStyle . '"><div class="frame-inner">';
    }
    $result .= do_shortcode($content);
    $result .= '</div></div></div>';
    return force_balance_tags($result);
}
开发者ID:kivivuori,项目名称:jotain,代码行数:32,代码来源:ait-boxes.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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