本文整理汇总了PHP中convert_chars函数的典型用法代码示例。如果您正苦于以下问题:PHP convert_chars函数的具体用法?PHP convert_chars怎么用?PHP convert_chars使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了convert_chars函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: newautop
function newautop($text)
{
$newtext = "";
$pos = 0;
$tags = array('<!-- noformat on -->', '<!-- noformat off -->');
$status = 0;
while (!(($newpos = strpos($text, $tags[$status], $pos)) === FALSE)) {
$sub = substr($text, $pos, $newpos - $pos);
if ($status) {
$newtext .= $sub;
} else {
$newtext .= convert_chars(wptexturize(wpautop($sub)));
}
//Apply both functions (faster)
$pos = $newpos + strlen($tags[$status]);
$status = $status ? 0 : 1;
}
$sub = substr($text, $pos, strlen($text) - $pos);
if ($status) {
$newtext .= $sub;
} else {
$newtext .= convert_chars(wptexturize(wpautop($sub)));
}
//Apply both functions (faster)
//To remove the tags
$newtext = str_replace($tags[0], "", $newtext);
$newtext = str_replace($tags[1], "", $newtext);
return $newtext;
}
示例2: credits_text
/**
* Update the credits text.
*
* @since 1.0.0
*
* @param string $text Credits text.
* @return string
*/
public function credits_text($text)
{
$settings = wp_parse_args((array) get_option('footer_credits'), array('placement' => '', 'text' => ''));
switch ($settings['placement']) {
case 'after':
$text .= ' ' . $settings['text'];
break;
case 'before':
$text = $settings['text'] . ' ' . $text;
break;
case 'remove':
$text = '';
break;
case 'replace':
$text = $settings['text'];
break;
}
$search = array('{{year}}');
$replace = array(date('Y'));
$text = str_replace($search, $replace, $text);
$text = wptexturize(trim($text));
$text = convert_chars($text);
$text = $this->allowed_tags($text);
return $text;
}
示例3: get
public function get()
{
$license = $this->get_license();
$downloads = $this->get_downloads();
$config = ["alwaysShowHours" => true, "alwaysShowControls" => true, "chaptersVisible" => true, "permalink" => get_permalink($this->post->ID), "publicationDate" => mysql2date("c", $this->post->post_date), "title" => get_the_title($this->post->ID), "subtitle" => wptexturize(convert_chars(trim($this->episode->subtitle))), "summary" => nl2br(wptexturize(convert_chars(trim($this->episode->summary)))), "poster" => $this->episode->cover_art_with_fallback()->setWidth(500)->url(), "show" => ['title' => $this->podcast->title, 'subtitle' => $this->podcast->subtitle, 'summary' => $this->podcast->summary, 'poster' => $this->podcast->cover_art()->setWidth(500)->url(), 'url' => \Podlove\get_landing_page_url()], "license" => ["name" => $license['name'], "url" => $license['url']], "downloads" => $downloads, "duration" => $this->episode->get_duration(), "features" => ["current", "progress", "duration", "tracks", "fullscreen", "volume"], "chapters" => json_decode($this->episode->get_chapters('json')), "languageCode" => $this->podcast->language];
return $config;
}
示例4: 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);
}
示例5: em_rss
function em_rss()
{
global $post, $wp_query;
if (!empty($_REQUEST['dbem_rss']) || is_object($post) && $post->ID == get_option('dbem_events_page') && $wp_query->get('rss')) {
header("Content-type: text/xml");
ob_start();
echo "<?xml version='1.0'?>\n";
?>
<rss version="2.0">
<channel>
<title><?php
echo get_option('dbem_rss_main_title');
?>
</title>
<link><?php
echo get_permalink(get_option('dbem_events_page'));
?>
</link>
<description><?php
echo get_option('dbem_rss_main_description');
?>
</description>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>Weblog Editor 2.0</generator>
<?php
$description_format = str_replace(">", ">", str_replace("<", "<", get_option('dbem_rss_description_format')));
$events = EM_Events::get(array('limit' => 5, 'owner' => false));
foreach ($events as $event) {
$description = $event->output(get_option('dbem_rss_description_format'), "rss");
$description = ent2ncr(convert_chars(strip_tags($description)));
//Some RSS filtering
?>
<item>
<title><?php
echo $event->output(get_option('dbem_rss_title_format'), "rss");
?>
</title>
<link><?php
echo $event->output('#_EVENTURL');
?>
</link>
<description><?php
echo $description;
?>
</description>
</item>
<?php
}
?>
</channel>
</rss>
<?php
echo apply_filters('em_rss', ob_get_clean());
die;
}
}
示例6: bloginfo
function bloginfo($show='') {
$info = get_bloginfo($show);
if ( ! (strstr($info, 'url') || strstr($info, 'directory')) ) {
$info = apply_filters('bloginfo', $info, $show);
$info = convert_chars($info);
}
echo $info;
}
示例7: apoc_custom_kses
/**
* Custom text sanitization and filtering
* @version 2.0
*/
function apoc_custom_kses($content)
{
$content = wp_filter_post_kses($content);
$content = wptexturize($content);
$content = wpautop($content);
$content = convert_chars($content);
$content = force_balance_tags($content);
return $content;
}
示例8: get_feed_description
/**
* Return feed description.
*
* @return string
*/
function get_feed_description()
{
$info = strip_tags(Settings\get_site_option('description'));
$description = apply_filters('get_bloginfo_rss', convert_chars($info));
if (!$description) {
$description = get_bloginfo_rss('description');
}
return apply_filters('inpsmf_feed_description', $description);
}
示例9: 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;
}
示例10: toni_css
function toni_css()
{
$toni_color = get_toni_color();
$url = get_bloginfo('stylesheet_url');
if (!empty($toni_color)) {
$url = str_replace('style.css', "style_{$toni_color}.css", $url);
}
$url = apply_filters('bloginfo', $url, 'stylesheet_url');
$url = convert_chars($url);
echo $url;
}
示例11: bloginfo
function bloginfo($show='') {
$info = get_bloginfo($show);
if (!strstr($show, 'url') && //don't filter URLs
!strstr($show, 'directory') &&
!strstr($show, 'home')) {
$info = apply_filters('bloginfo', $info, $show);
$info = convert_chars($info);
}
echo $info;
}
示例12: bloginfo
function bloginfo($show = '')
{
$info = get_bloginfo($show);
// Don't filter URL's.
if (strpos($show, 'url') === false && strpos($show, 'directory') === false && strpos($show, 'home') === false) {
$info = apply_filters('bloginfo', $info, $show);
$info = convert_chars($info);
} else {
$info = apply_filters('bloginfo_url', $info, $show);
}
echo $info;
}
示例13: the_excerpt_rss
function the_excerpt_rss($content)
{
global $post, $EM_Event;
if ($post->post_type == EM_POST_TYPE_EVENT) {
if (get_option('dbem_cp_events_formats')) {
$EM_Event = em_get_event($post);
$content = $EM_Event->output(get_option('dbem_rss_description_format'), "rss");
$content = ent2ncr(convert_chars($content));
//Some RSS filtering
}
}
return $content;
}
示例14: widget
/**
* How to display the widget on the screen.
*/
function widget($args, $instance)
{
extract($args);
/* Our variables from the widget settings. */
$title = $instance['title'];
$num_comments = $instance['number_comments'];
$args = array('number' => $num_comments, 'status' => 'approve');
$comments = get_comments($args);
if (count($comments) == 0) {
?>
<!-- Note, MBU: Recent Comments Widget not shown. No comments to display -->
<?php
} else {
/* Before widget (defined by themes). */
echo $before_widget;
?>
<div id="recent-comments" >
<h2><?php
echo $title;
?>
</h2>
<ul>
<?php
foreach ($comments as $comment) {
$commented_post = get_post($comment->comment_post_ID);
$commented_post_link = convert_chars(get_post_permalink($comment->comment_post_ID)) . '#comment-' . $comment->comment_ID;
?>
<li>
<a href="<?php
echo $commented_post_link;
?>
" title="<?php
printf(_x('By %1$s on %2$s.', ' By [comment author] on [post title]', TEMPLATE_DOMAIN), $comment->comment_author, $commented_post->post_title);
?>
" ><?php
echo $comment->comment_content;
?>
</a>
</li>
<?php
}
?>
</ul>
</div>
<?php
/* After widget (defined by themes). */
echo $after_widget;
}
}
示例15: sdm_get_item_description_output
function sdm_get_item_description_output($id)
{
$item_description = get_post_meta($id, 'sdm_description', true);
$isset_item_description = isset($item_description) && !empty($item_description) ? $item_description : '';
//$isset_item_description = apply_filters('the_content', $isset_item_description);
$isset_item_description = do_shortcode($isset_item_description);
$isset_item_description = wptexturize($isset_item_description);
$isset_item_description = convert_smilies($isset_item_description);
$isset_item_description = convert_chars($isset_item_description);
$isset_item_description = wpautop($isset_item_description);
$isset_item_description = shortcode_unautop($isset_item_description);
$isset_item_description = prepend_attachment($isset_item_description);
return $isset_item_description;
}