convert_chars [ WordPress Function ]
convert_chars ( $content, $deprecated = '' )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: convert_smilies, wp_convert_hr_to_bytes, comment_class, convert_to_screen, count_users
Converts a number of characters from a string.
Metadata tags <
> and <
are converted into correct XHTML and Unicode characters are converted to the valid range.
Source
<?php
function convert_chars($content, $deprecated = '') {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '0.71' );
// Translation of invalid Unicode references range to valid range
$wp_htmltranswinuni = array(
'€' => '€', // the Euro sign
'' => '',
'‚' => '‚', // these are Windows CP1252 specific characters
'ƒ' => 'ƒ', // they would look weird on non-Windows browsers
'„' => '„',
'…' => '…',
'†' => '†',
'‡' => '‡',
'ˆ' => 'ˆ',
'‰' => '‰',
'Š' => 'Š',
'‹' => '‹',
'Œ' => 'Œ',
'' => '',
'Ž' => 'Ž',
'' => '',
'' => '',
'‘' => '‘',
'’' => '’',
'“' => '“',
'”' => '”',
'•' => '•',
'–' => '–',
'—' => '—',
'˜' => '˜',
'™' => '™',
'š' => 'š',
'›' => '›',
'œ' => 'œ',
'' => '',
'ž' => 'ž',
'Ÿ' => 'Ÿ'
);
// Remove metadata tags
$content = preg_replace('/<title>(.+?)<\/title>/','',$content);
$content = preg_replace('/<category>(.+?)<\/category>/','',$content);
// Converts lone & characters into & (a.k.a. &)
$content = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/i', '&$1', $content);
// Fix Word pasting
$content = strtr($content, $wp_htmltranswinuni);
// Just a little XHTML help
$content = str_replace('<br>', '<br />', $content);
$content = str_replace('<hr>', '<hr />', $content);
return $content;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/convert chars « WordPress Codex
Description. Converts a number of characters from a string. Metadata tags <title> and <category> are removed, <br> and <hr> are converted into correct XHTML ...
codex.wordpress.org - convert_chars | A HitchHackers guide through WordPress
Feb 11, 2011 ... function convert_chars($content, $deprecated = '') {}. Converts a number of characters from a string. Metadata tags title>> and category>> are ...
hitchhackerguide.com - bp_get_group_description_excerpt - etivite
add_filter( 'bp_get_group_description', 'convert_chars' ); add_filter( ' bp_get_group_description_excerpt', 'convert_chars' ); add_filter( ' bp_get_group_name', ...
etivite.com - Removing the Smart Quotes from your WordPress Blog | bavotasan ...
Nov 17, 2008 ... Display filters //add_filter('the_title', 'wptexturize'); add_filter('the_title', ' convert_chars'); add_filter('the_title', 'trim'); //add_filter('the_content', ...
bavotasan.com