Make WordPress Core

Changeset 32590


Ignore:
Timestamp:
05/25/2015 02:58:00 AM (9 years ago)
Author:
wonderboymusic
Message:

Add missing doc blocks to formatting.php.
Rehabilitate the spacing of various doc blocks.
Standardize some return values that are adjacent to similar functions.

See #32444.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r32520 r32590  
    2222 *
    2323 * @since 0.71
    24  * @uses $wp_cockneyreplace Array of formatted entities for certain common phrases
     24 *
     25 * @global array $wp_cockneyreplace Array of formatted entities for certain common phrases
     26 * @global array $shortcode_tags
     27 * @staticvar array $static_characters
     28 * @staticvar array $static_replacements
     29 * @staticvar array $dynamic_characters
     30 * @staticvar array $dynamic_replacements
     31 * @staticvar array $default_no_texturize_tags
     32 * @staticvar array $default_no_texturize_shortcodes
     33 * @staticvar bool  $run_texturize
    2534 *
    2635 * @param string $text The text to be formatted
    27  * @param bool $reset Set to true for unit testing. Translated patterns will reset.
     36 * @param bool   $reset Set to true for unit testing. Translated patterns will reset.
    2837 * @return string The string replaced with html entities
    2938 */
    30 function wptexturize($text, $reset = false) {
     39function wptexturize( $text, $reset = false ) {
    3140    global $wp_cockneyreplace, $shortcode_tags;
    3241    static $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements,
     
    298307
    299308    // Replace each & with & unless it already looks like an entity.
    300     $text = preg_replace('/&(?!#(?:\d+|x[a-f0-9]+);|[a-z1-4]{1,8};)/i', '&', $text);
    301 
    302     return $text;
     309    return preg_replace( '/&(?!#(?:\d+|x[a-f0-9]+);|[a-z1-4]{1,8};)/i', '&', $text );
    303310}
    304311
     
    314321 *
    315322 * @param string $text Text to check. Must be a tag like `<html>` or `[shortcode]`.
    316  * @param array $stack List of open tag elements.
    317  * @param array $disabled_elements The tag names to match against. Spaces are not allowed in tag names.
    318  */
    319 function _wptexturize_pushpop_element($text, &$stack, $disabled_elements) {
     323 * @param array  $stack List of open tag elements.
     324 * @param array  $disabled_elements The tag names to match against. Spaces are not allowed in tag names.
     325 */
     326function _wptexturize_pushpop_element( $text, &$stack, $disabled_elements ) {
    320327    // Is it an opening tag or closing tag?
    321328    if ( '/' !== $text[1] ) {
     
    371378 * @return string Text which has been converted into correct paragraph tags.
    372379 */
    373 function wpautop($pee, $br = true) {
     380function wpautop( $pee, $br = true ) {
    374381    $pre_tags = array();
    375382
     
    420427
    421428    // Standardize newline characters to "\n".
    422     $pee = str_replace(array("\r\n", "\r"), "\n", $pee); 
     429    $pee = str_replace(array("\r\n", "\r"), "\n", $pee);
    423430
    424431    // Collapse line breaks before and after <option> elements so they don't get autop'd.
     
    463470
    464471    // Under certain strange conditions it could create a P of entirely whitespace.
    465     $pee = preg_replace('|<p>\s*</p>|', '', $pee); 
     472    $pee = preg_replace('|<p>\s*</p>|', '', $pee);
    466473
    467474    // Add a closing <p> inside <div>, <address>, or <form> tag if missing.
    468475    $pee = preg_replace('!<p>([^<]+)</(div|address|form)>!', "<p>$1</p></$2>", $pee);
    469    
     476
    470477    // If an opening or closing block element tag is wrapped in a <p>, unwrap it.
    471     $pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); 
    472    
     478    $pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee);
     479
    473480    // In some cases <li> may get wrapped in <p>, fix them.
    474     $pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); 
    475    
     481    $pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee);
     482
    476483    // If a <blockquote> is wrapped with a <p>, move it inside the <blockquote>.
    477484    $pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee);
    478485    $pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);
    479    
     486
    480487    // If an opening or closing block element tag is preceded by an opening <p> tag, remove it.
    481488    $pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee);
    482    
     489
    483490    // If an opening or closing block element tag is followed by a closing <p> tag, remove it.
    484491    $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee);
     
    490497
    491498        // Replace any new line characters that aren't preceded by a <br /> with a <br />.
    492         $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); 
     499        $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee);
    493500
    494501        // Replace newline placeholders with newlines.
     
    498505    // If a <br /> tag is after an opening or closing block tag, remove it.
    499506    $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*<br />!', "$1", $pee);
    500    
     507
    501508    // If a <br /> tag is before a subset of opening or closing block tags, remove it.
    502509    $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $pee);
     
    520527 */
    521528function _autop_newline_preservation_helper( $matches ) {
    522     return str_replace("\n", "<WPPreserveNewline />", $matches[0]);
     529    return str_replace( "\n", "<WPPreserveNewline />", $matches[0] );
    523530}
    524531
     
    529536 *
    530537 * @since 2.9.0
     538 *
     539 * @global array $shortcode_tags
    531540 *
    532541 * @param string $pee The content.
     
    590599 * @return bool True if $str fits a UTF-8 model, false otherwise.
    591600 */
    592 function seems_utf8($str) {
     601function seems_utf8( $str ) {
    593602    mbstring_binary_safe_encoding();
    594603    $length = strlen($str);
     
    622631 * @access private
    623632 *
    624  * @param string $string The text which is to be encoded.
    625  * @param int $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES.
    626  * @param string $charset Optional. The character encoding of the string. Default is false.
    627  * @param boolean $double_encode Optional. Whether to encode existing html entities. Default is false.
     633 * @staticvar string|false $_charset
     634 *
     635 * @param string $string         The text which is to be encoded.
     636 * @param int    $quote_style    Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES.
     637 * @param string $charset        Optional. The character encoding of the string. Default is false.
     638 * @param bool   $double_encode  Optional. Whether to encode existing html entities. Default is false.
    628639 * @return string The encoded text with HTML entities.
    629640 */
     
    702713 * @since 2.8.0
    703714 *
    704  * @param string $string The text which is to be decoded.
    705  * @param mixed $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old _wp_specialchars() values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES.
     715 * @param string     $string The text which is to be decoded.
     716 * @param string|int $quote_style Optional. Converts double quotes if set to ENT_COMPAT,
     717 *                                both single and double if set to ENT_QUOTES or
     718 *                                none if set to ENT_NOQUOTES.
     719 *                                Also compatible with old _wp_specialchars() values;
     720 *                                converting single quotes if set to 'single',
     721 *                                double if set to 'double' or both if otherwise set.
     722 *                                Default is ENT_NOQUOTES.
    706723 * @return string The decoded text without HTML entities.
    707724 */
     
    759776 * @since 2.8.0
    760777 *
    761  * @param string $string The text which is to be checked.
    762  * @param boolean $strip Optional. Whether to attempt to strip out invalid UTF8. Default is false.
     778 * @staticvar bool $is_utf8
     779 * @staticvar bool $utf8_pcre
     780 *
     781 * @param string  $string The text which is to be checked.
     782 * @param bool    $strip Optional. Whether to attempt to strip out invalid UTF8. Default is false.
    763783 * @return string The checked text.
    764784 */
     
    808828 *
    809829 * @param string $utf8_string
    810  * @param int $length Max length of the string
     830 * @param int    $length Max length of the string
    811831 * @return string String with Unicode encoded for URI.
    812832 */
     
    871891 * @return string Filtered string with replaced "nice" characters.
    872892 */
    873 function remove_accents($string) {
     893function remove_accents( $string ) {
    874894    if ( !preg_match('/[\x80-\xff]/', $string) )
    875895        return $string;
     
    11881208 *
    11891209 * @param string $username The username to be sanitized.
    1190  * @param bool $strict If set limits $username to specific characters. Default false.
     1210 * @param bool   $strict  If set limits $username to specific characters. Default false.
    11911211 * @return string The sanitized username, after passing through filters.
    11921212 */
     
    12541274 * @since 1.0.0
    12551275 *
    1256  * @param string $title The string to be sanitized.
     1276 * @param string $title          The string to be sanitized.
    12571277 * @param string $fallback_title Optional. A title to use if $title is empty.
    1258  * @param string $context Optional. The operation for which the string is sanitized
     1278 * @param string $context        Optional. The operation for which the string is sanitized
    12591279 * @return string The sanitized string.
    12601280 */
     
    13041324 * @since 1.2.0
    13051325 *
    1306  * @param string $title The title to be sanitized.
     1326 * @param string $title     The title to be sanitized.
    13071327 * @param string $raw_title Optional. Not used.
    1308  * @param string $context Optional. The operation for which the string is sanitized.
     1328 * @param string $context   Optional. The operation for which the string is sanitized.
    13091329 * @return string The sanitized title.
    13101330 */
     
    13731393 *
    13741394 * @param string $orderby Order by clause to be validated.
    1375  * @return string|bool Returns $orderby if valid, false otherwise.
     1395 * @return string|false Returns $orderby if valid, false otherwise.
    13761396 */
    13771397function sanitize_sql_orderby( $orderby ) {
     
    13921412 * @since 2.8.0
    13931413 *
    1394  * @param string $class The classname to be sanitized
     1414 * @param string $class    The classname to be sanitized
    13951415 * @param string $fallback Optional. The value to return if the sanitization ends up as an empty string.
    13961416 *  Defaults to an empty string.
     
    14281448 * @since 0.71
    14291449 *
    1430  * @param string $content String of characters to be converted.
     1450 * @param string $content    String of characters to be converted.
    14311451 * @param string $deprecated Not used.
    14321452 * @return string Converted string.
    14331453 */
    1434 function convert_chars($content, $deprecated = '') {
     1454function convert_chars( $content, $deprecated = '' ) {
    14351455    if ( !empty( $deprecated ) )
    14361456        _deprecated_argument( __FUNCTION__, '0.71' );
     
    14941514 * @since 0.71
    14951515 *
    1496  * @param string $text Text to be balanced
    1497  * @param bool $force If true, forces balancing, ignoring the value of the option. Default false.
     1516 * @param string $text  Text to be balanced
     1517 * @param bool   $force If true, forces balancing, ignoring the value of the option. Default false.
    14981518 * @return string Balanced text
    14991519 */
     
    16461666 * @since 0.71
    16471667 *
    1648  * @param string $content The text about to be edited.
    1649  * @param bool $richedit Whether the $content should not pass through htmlspecialchars(). Default false (meaning it will be passed).
     1668 * @param string $content  The text about to be edited.
     1669 * @param bool   $richedit Whether the $content should not pass through htmlspecialchars(). Default false (meaning it will be passed).
    16501670 * @return string The text after the filter (and possibly htmlspecialchars()) has been run.
    16511671 */
     
    16771697 * @since 0.71
    16781698 *
    1679  * @param mixed $number Number to append zeros to if not greater than threshold.
    1680  * @param int $threshold Digit places number needs to be to not have zeros added.
     1699 * @param int $number    Number to append zeros to if not greater than threshold.
     1700 * @param int $threshold  Digit places number needs to be to not have zeros added.
    16811701 * @return string Adds leading zeros to number if needed.
    16821702 */
    1683 function zeroise($number, $threshold) {
    1684     return sprintf('%0'.$threshold.'s', $number);
     1703function zeroise( $number, $threshold ) {
     1704    return sprintf( '%0' . $threshold . 's', $number );
    16851705}
    16861706
     
    16931713 * @return string String with backslashes inserted.
    16941714 */
    1695 function backslashit($string) {
     1715function backslashit( $string ) {
    16961716    if ( isset( $string[0] ) && $string[0] >= '0' && $string[0] <= '9' )
    16971717        $string = '\\\\' . $string;
     
    17611781 * @return mixed Stripped value.
    17621782 */
    1763 function stripslashes_deep($value) {
     1783function stripslashes_deep( $value ) {
    17641784    if ( is_array($value) ) {
    17651785        $value = array_map('stripslashes_deep', $value);
     
    17851805 * @return array|string $value The encoded array (or string from the callback).
    17861806 */
    1787 function urlencode_deep($value) {
    1788     $value = is_array($value) ? array_map('urlencode_deep', $value) : urlencode($value);
    1789     return $value;
     1807function urlencode_deep( $value ) {
     1808    return is_array( $value ) ? array_map( 'urlencode_deep', $value ) : urlencode( $value );
    17901809}
    17911810
     
    18081827 *
    18091828 * @param string $email_address Email address.
    1810  * @param int $hex_encoding Optional. Set to 1 to enable hex encoding.
     1829 * @param int    $hex_encoding Optional. Set to 1 to enable hex encoding.
    18111830 * @return string Converted email address.
    18121831 */
     
    18241843    }
    18251844
    1826     $email_no_spam_address = str_replace( '@', '&#64;', $email_no_spam_address );
    1827 
    1828     return $email_no_spam_address;
     1845    return str_replace( '@', '&#64;', $email_no_spam_address );
    18291846}
    18301847
     
    18411858 * @return string HTML A element with URI address.
    18421859 */
    1843 function _make_url_clickable_cb($matches) {
     1860function _make_url_clickable_cb( $matches ) {
    18441861    $url = $matches[2];
    18451862
     
    18781895 * @return string HTML A element with URL address.
    18791896 */
    1880 function _make_web_ftp_clickable_cb($matches) {
     1897function _make_web_ftp_clickable_cb( $matches ) {
    18811898    $ret = '';
    18821899    $dest = $matches[2];
     
    19061923 * @return string HTML A element with email address.
    19071924 */
    1908 function _make_email_clickable_cb($matches) {
     1925function _make_email_clickable_cb( $matches ) {
    19091926    $email = $matches[2] . '@' . $matches[3];
    19101927    return $matches[1] . "<a href=\"mailto:$email\">$email</a>";
     
    19771994
    19781995    // Cleanup of accidental links within links
    1979     $r = preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "$1$3</a>", $r );
    1980     return $r;
     1996    return preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "$1$3</a>", $r );
    19811997}
    19821998
     
    20072023 *
    20082024 * @param string $string The string to split.
    2009  * @param int $goal The desired chunk length.
     2025 * @param int    $goal  The desired chunk length.
    20102026 * @return array Numeric array of chunks.
    20112027 */
     
    20492065    $text = stripslashes($text);
    20502066    $text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text);
    2051     $text = wp_slash($text);
    2052     return $text;
     2067    return wp_slash( $text );
    20532068}
    20542069
     
    20772092 * `<img>` string for that smiley.
    20782093 *
     2094 * @since 2.8.0
     2095 *
    20792096 * @global array $wpsmiliestrans
    2080  * @since 2.8.0
    20812097 *
    20822098 * @param array $matches Single match. Smiley code to convert to image.
     
    21222138 *
    21232139 * @since 0.71
    2124  * @uses $wp_smiliessearch
     2140 *
     2141 * @global string|array $wp_smiliessearch
    21252142 *
    21262143 * @param string $text Content to convert smilies from text.
     
    21732190 * @since 0.71
    21742191 *
    2175  * @param string $email Email address to verify.
    2176  * @param boolean $deprecated Deprecated.
     2192 * @param string $email      Email address to verify.
     2193 * @param bool  $deprecated Deprecated.
    21772194 * @return string|bool Either false or the valid email address.
    21782195 */
     
    22662283 * @return string Converted string to ASCII
    22672284 */
    2268 function wp_iso_descrambler($string) {
     2285function wp_iso_descrambler( $string ) {
    22692286    /* this may only work with iso-8859-1, I'm afraid */
    22702287    if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $string, $matches)) {
     
    22722289    } else {
    22732290        $subject = str_replace('_', ' ', $matches[2]);
    2274         $subject = preg_replace_callback('#\=([0-9a-f]{2})#i', '_wp_iso_convert', $subject);
    2275         return $subject;
     2291        return preg_replace_callback( '#\=([0-9a-f]{2})#i', '_wp_iso_convert', $subject );
    22762292    }
    22772293}
     
    23602376 * @return int|float The offset in seconds.
    23612377 */
    2362 function iso8601_timezone_to_offset($timezone) {
     2378function iso8601_timezone_to_offset( $timezone ) {
    23632379    // $timezone is either 'Z' or '[+|-]hhmm'
    23642380    if ($timezone == 'Z') {
     
    23792395 *
    23802396 * @param string $date_string Date and time in ISO 8601 format {@link http://en.wikipedia.org/wiki/ISO_8601}.
    2381  * @param string $timezone Optional. If set to GMT returns the time minus gmt_offset. Default is 'user'.
     2397 * @param string $timezone    Optional. If set to GMT returns the time minus gmt_offset. Default is 'user'.
    23822398 * @return string The date and time in MySQL DateTime format - Y-m-d H:i:s.
    23832399 */
    2384 function iso8601_to_datetime($date_string, $timezone = 'user') {
     2400function iso8601_to_datetime( $date_string, $timezone = 'user' ) {
    23852401    $timezone = strtolower($timezone);
    23862402
     
    24172433 * @return string Content that has filtered links.
    24182434 */
    2419 function popuplinks($text) {
     2435function popuplinks( $text ) {
    24202436    $text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text);
    24212437    return $text;
     
    25332549 *
    25342550 * @param int $from Unix timestamp from which the difference begins.
    2535  * @param int $to Optional. Unix timestamp to end the time difference. Default becomes time() if not set.
     2551 * @param int $to   Optional. Unix timestamp to end the time difference. Default becomes time() if not set.
    25362552 * @return string Human readable time difference.
    25372553 */
     
    26042620 * @return string The excerpt.
    26052621 */
    2606 function wp_trim_excerpt($text = '') {
     2622function wp_trim_excerpt( $text = '' ) {
    26072623    $raw_excerpt = $text;
    26082624    if ( '' == $text ) {
     
    26532669 * @since 3.3.0
    26542670 *
    2655  * @param string $text Text to trim.
    2656  * @param int $num_words Number of words. Default 55.
    2657  * @param string $more Optional. What to append if $text needs to be trimmed. Default '&hellip;'.
     2671 * @param string $text      Text to trim.
     2672 * @param int    $num_words Number of words. Default 55.
     2673 * @param string $more      Optional. What to append if $text needs to be trimmed. Default '&hellip;'.
    26582674 * @return string Trimmed text.
    26592675 */
     
    27022718 * @return string Text with converted entities.
    27032719 */
    2704 function ent2ncr($text) {
     2720function ent2ncr( $text ) {
    27052721
    27062722    /**
     
    29913007 * @return string The formatted text after filter is applied.
    29923008 */
    2993 function wp_richedit_pre($text) {
     3009function wp_richedit_pre( $text ) {
    29943010    if ( empty( $text ) ) {
    29953011        /**
     
    30293045 * @return string Formatted text after filter applied.
    30303046 */
    3031 function wp_htmledit_pre($output) {
     3047function wp_htmledit_pre( $output ) {
    30323048    if ( !empty($output) )
    30333049        $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // convert only < > &
     
    30533069 * @access private
    30543070 *
    3055  * @param string|array $search The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.
    3056  * @param string $subject The string being searched and replaced on, otherwise known as the haystack.
     3071 * @param string|array $search  The value being searched for, otherwise known as the needle.
     3072 *                              An array may be used to designate multiple needles.
     3073 * @param string       $subject The string being searched and replaced on, otherwise known as the haystack.
    30573074 * @return string The string with the replaced svalues.
    30583075 */
     
    30763093 *
    30773094 * @since 2.8.0
     3095 *
     3096 * @global wpdb $wpdb
     3097 *
    30783098 * @param string|array $data Unescaped data
    30793099 * @return string|array Escaped data
     
    30933113 * @since 2.8.0
    30943114 *
    3095  * @param string $url The URL to be cleaned.
    3096  * @param array $protocols Optional. An array of acceptable protocols.
    3097  *      Defaults to 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn' if not set.
    3098  * @param string $_context Private. Use esc_url_raw() for database usage.
     3115 * @param string $url       The URL to be cleaned.
     3116 * @param array  $protocols Optional. An array of acceptable protocols.
     3117 *                          Defaults to 'http', 'https', 'ftp', 'ftps', 'mailto',
     3118 *                          'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms',
     3119 *                          'rtsp', 'svn' if not set.
     3120 * @param string $_context  Private. Use esc_url_raw() for database usage.
    30993121 * @return string The cleaned $url after the 'clean_url' filter is applied.
    31003122 */
     
    31503172 * @since 2.8.0
    31513173 *
    3152  * @param string $url The URL to be cleaned.
    3153  * @param array $protocols An array of acceptable protocols.
     3174 * @param string $url       The URL to be cleaned.
     3175 * @param array  $protocols An array of acceptable protocols.
    31543176 * @return string The cleaned URL.
    31553177 */
     
    31683190 * @return string Converted text.
    31693191 */
    3170 function htmlentities2($myHTML) {
     3192function htmlentities2( $myHTML ) {
    31713193    $translation_table = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES );
    31723194    $translation_table[chr(38)] = '&';
     
    32853307 * @return string
    32863308 */
    3287 function tag_escape($tag_name) {
     3309function tag_escape( $tag_name ) {
    32883310    $safe_tag = strtolower( preg_replace('/[^a-zA-Z0-9_:]/', '', $tag_name) );
    32893311    /**
     
    33223344 * @since 2.0.5
    33233345 *
     3346 * @global wpdb $wpdb
     3347 *
    33243348 * @param string $option The name of the option.
    3325  * @param string $value The unsanitised value.
     3349 * @param string $value  The unsanitised value.
    33263350 * @return string Sanitized value.
    33273351 */
    3328 function sanitize_option($option, $value) {
     3352function sanitize_option( $option, $value ) {
    33293353    global $wpdb;
    33303354
     
    35243548     * @param string $original_value The original value passed to the function.
    35253549     */
    3526     $value = apply_filters( "sanitize_option_{$option}", $value, $option, $original_value );
    3527 
    3528     return $value;
     3550    return apply_filters( "sanitize_option_{$option}", $value, $option, $original_value );
    35293551}
    35303552
     
    35383560 *
    35393561 * @param string $string The string to be parsed.
    3540  * @param array $array Variables will be stored in this array.
     3562 * @param array  $array Variables will be stored in this array.
    35413563 */
    35423564function wp_parse_str( $string, &$array ) {
     
    35883610 * @link http://www.php.net/sprintf
    35893611 *
    3590  * @param string $pattern The string which formatted args are inserted.
     3612 * @param string $pattern   The string which formatted args are inserted.
    35913613 * @param mixed  $args ,... Arguments to be formatted into the $pattern string.
    35923614 * @return string The formatted string.
     
    36633685 *
    36643686 * @param string $pattern Content containing '%l' at the beginning.
    3665  * @param array $args List items to prepend to the content and replace '%l'.
     3687 * @param array  $args    List items to prepend to the content and replace '%l'.
    36663688 * @return string Localized list items and rest of the content.
    36673689 */
    3668 function wp_sprintf_l($pattern, $args) {
     3690function wp_sprintf_l( $pattern, $args ) {
    36693691    // Not a match
    36703692    if ( substr($pattern, 0, 2) != '%l' )
     
    37213743 * @since 2.5.0
    37223744 *
    3723  * @param string $str String to get the excerpt from.
    3724  * @param integer $count Maximum number of characters to take.
    3725  * @param string $more Optional. What to append if $str needs to be trimmed. Defaults to empty string.
     3745 * @param string $str   String to get the excerpt from.
     3746 * @param int    $count Maximum number of characters to take.
     3747 * @param string $more  Optional. What to append if $str needs to be trimmed. Defaults to empty string.
    37263748 * @return string The excerpt.
    37273749 */
     
    37463768 * @since 2.7.0
    37473769 *
     3770 * @global string $_links_add_base
     3771 *
    37483772 * @param string $content String to search for links in.
    3749  * @param string $base The base URL to prefix to links.
    3750  * @param array $attrs The attributes which should be processed.
     3773 * @param string $base    The base URL to prefix to links.
     3774 * @param array  $attrs  The attributes which should be processed.
    37513775 * @return string The processed content.
    37523776 */
     
    37643788 * @access private
    37653789 *
     3790 * @global string $_links_add_base
     3791 *
    37663792 * @param string $m The matched link.
    37673793 * @return string The processed link.
    37683794 */
    3769 function _links_add_base($m) {
     3795function _links_add_base( $m ) {
    37703796    global $_links_add_base;
    37713797    //1 = attribute name  2 = quotation mark  3 = URL
     
    37883814 * @since 2.7.0
    37893815 *
     3816 * @global string $_links_add_target
     3817 *
    37903818 * @param string $content String to search for links in.
    3791  * @param string $target The Target to add to the links.
    3792  * @param array $tags An array of tags to apply to.
     3819 * @param string $target  The Target to add to the links.
     3820 * @param array  $tags    An array of tags to apply to.
    37933821 * @return string The processed content.
    37943822 */
     
    38063834 * @access private
    38073835 *
     3836 * @global string $_links_add_target
     3837 *
    38083838 * @param string $m The matched link.
    38093839 * @return string The processed link.
     
    38403870 * @since 2.9.0
    38413871 *
    3842  * @param string $string String containing HTML tags
    3843  * @param bool $remove_breaks optional Whether to remove left over line breaks and white space chars
     3872 * @param string $string        String containing HTML tags
     3873 * @param bool   $remove_breaks Optional. Whether to remove left over line breaks and white space chars
    38443874 * @return string The processed string.
    38453875 */
     
    38683898 * @return string
    38693899 */
    3870 function sanitize_text_field($str) {
     3900function sanitize_text_field( $str ) {
    38713901    $filtered = wp_check_invalid_utf8( $str );
    38723902
     
    39063936 * @since 3.1.0
    39073937 *
    3908  * @param string $path A path.
     3938 * @param string $path   A path.
    39093939 * @param string $suffix If the filename ends in suffix this will also be cut off.
    39103940 * @return string
     
    39203950 *
    39213951 * @since 3.0.0
     3952 *
     3953 * @staticvar string|false $dblq
    39223954 */
    39233955function capital_P_dangit( $text ) {
     
    40364068 *
    40374069 * @param string $content A string which might contain a URL.
    4038  * @return string The found URL.
     4070 * @return string|false The found URL.
    40394071 */
    40404072function get_url_in_content( $content ) {
     
    40584090 *
    40594091 * @since 4.0.0
     4092 *
     4093 * @staticvar string $spaces
    40604094 *
    40614095 * @return string The spaces regexp.
     
    40874121 *
    40884122 * @since 4.2.0
     4123 *
     4124 * @staticvar bool $printed
    40894125 */
    40904126function print_emoji_styles() {
     
    41144150}
    41154151
     4152/**
     4153 *
     4154 * @global string $wp_version
     4155 * @staticvar bool $printed
     4156 */
    41164157function print_emoji_detection_script() {
    41174158    global $wp_version;
Note: See TracChangeset for help on using the changeset viewer.