Make WordPress Core

Changeset 26485


Ignore:
Timestamp:
11/30/2013 06:35:37 PM (11 years ago)
Author:
DrewAPicture
Message:

Inline documentation for hooks in wp-includes/formatting.php.

Props simonwheatley for the initial patch. Props DrewAPicture, kpdesign.
Fixes #25518.

File:
1 edited

Legend:

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

    r26328 r26485  
    102102    // Transform into regexp sub-expression used in _wptexturize_pushpop_element
    103103    // Must do this every time in case plugins use these filters in a context sensitive manner
    104     $no_texturize_tags = '(' . implode('|', apply_filters('no_texturize_tags', $default_no_texturize_tags) ) . ')';
    105     $no_texturize_shortcodes = '(' . implode('|', apply_filters('no_texturize_shortcodes', $default_no_texturize_shortcodes) ) . ')';
     104    /**
     105     * Filter the list of HTML elements not to texturize.
     106     *
     107     * @since 2.8.0
     108     *
     109     * @param array $default_no_texturize_tags An array of HTML element names.
     110     */
     111    $no_texturize_tags = '(' . implode( '|', apply_filters( 'no_texturize_tags', $default_no_texturize_tags ) ) . ')';
     112    /**
     113     * Filter the list of shortcodes not to texturize.
     114     *
     115     * @since 2.8.0
     116     *
     117     * @param array $default_no_texturize_shortcodes An array of shortcode names.
     118     */
     119    $no_texturize_shortcodes = '(' . implode( '|', apply_filters( 'no_texturize_shortcodes', $default_no_texturize_shortcodes ) ) . ')';
    106120
    107121    $no_texturize_tags_stack = array();
     
    843857    $filename_raw = $filename;
    844858    $special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", chr(0));
    845     $special_chars = apply_filters('sanitize_file_name_chars', $special_chars, $filename_raw);
     859    /**
     860     * Filter the list of characters to remove from a filename.
     861     *
     862     * @since 2.8.0
     863     *
     864     * @param array  $special_chars Characters to remove.
     865     * @param string $filename_raw  Filename as it was passed into sanitize_file_name().
     866     */
     867    $special_chars = apply_filters( 'sanitize_file_name_chars', $special_chars, $filename_raw );
    846868    $filename = str_replace($special_chars, '', $filename);
    847869    $filename = preg_replace('/[\s-]+/', '-', $filename);
     
    852874
    853875    // Return if only one extension
    854     if ( count($parts) <= 2 )
    855         return apply_filters('sanitize_file_name', $filename, $filename_raw);
     876    if ( count( $parts ) <= 2 ) {
     877        /**
     878         * Filter a sanitized filename string.
     879         *
     880         * @since 2.8.0
     881         *
     882         * @param string $filename     Sanitized filename.
     883         * @param string $filename_raw The filename prior to sanitization.
     884         */
     885        return apply_filters( 'sanitize_file_name', $filename, $filename_raw );
     886    }
    856887
    857888    // Process multiple extensions
     
    860891    $mimes = get_allowed_mime_types();
    861892
    862     // Loop over any intermediate extensions. Munge them with a trailing underscore if they are a 2 - 5 character
    863     // long alpha string not in the extension whitelist.
     893    /*
     894     * Loop over any intermediate extensions. Postfix them with a trailing underscore
     895     * if they are a 2 - 5 character long alpha string not in the extension whitelist.
     896     */
    864897    foreach ( (array) $parts as $part) {
    865898        $filename .= '.' . $part;
     
    879912    }
    880913    $filename .= '.' . $extension;
    881 
     914    /** This filter is documented in wp-includes/formatting.php */
    882915    return apply_filters('sanitize_file_name', $filename, $filename_raw);
    883916}
     
    892925 *
    893926 * @since 2.0.0
    894  * @uses apply_filters() Calls 'sanitize_user' hook on username, raw username,
    895  *      and $strict parameter.
    896927 *
    897928 * @param string $username The username to be sanitized.
     
    915946    $username = preg_replace( '|\s+|', ' ', $username );
    916947
     948    /**
     949     * Filter a sanitized username string.
     950     *
     951     * @since 2.0.11
     952     *
     953     * @param string $username     Sanitized username.
     954     * @param string $raw_username The username prior to sanitization.
     955     * @param bool   $strict       Whether to limit the sanitization to specific characters. Default false.
     956     */
    917957    return apply_filters( 'sanitize_user', $username, $raw_username, $strict );
    918958}
     
    932972    $key = strtolower( $key );
    933973    $key = preg_replace( '/[^a-z0-9_\-]/', '', $key );
     974
     975    /**
     976     * Filter a sanitized key string.
     977     *
     978     * @since 3.0.0
     979     *
     980     * @param string $key     Sanitized key.
     981     * @param string $raw_key The key prior to sanitization.
     982     */
    934983    return apply_filters( 'sanitize_key', $key, $raw_key );
    935984}
     
    9551004        $title = remove_accents($title);
    9561005
    957     $title = apply_filters('sanitize_title', $title, $raw_title, $context);
     1006    /**
     1007     * Filter a sanitized title string.
     1008     *
     1009     * @since 1.2.1
     1010     *
     1011     * @param string $title     Sanitized title.
     1012     * @param string $raw_title The title prior to sanitization.
     1013     * @param string $context   The context for which the title is being sanitized.
     1014     */
     1015    $title = apply_filters( 'sanitize_title', $title, $raw_title, $context );
    9581016
    9591017    if ( '' === $title || false === $title )
     
    10871145        $sanitized = $fallback;
    10881146
     1147    /**
     1148     * Filter a sanitized HTML class string.
     1149     *
     1150     * @since 2.8.0
     1151     *
     1152     * @param string $sanitized The sanitized HTML class.
     1153     * @param string $class     HTML class before sanitization.
     1154     * @param string $fallback  The fallback string.
     1155     */
    10891156    return apply_filters( 'sanitize_html_class', $sanitized, $class, $fallback );
    10901157}
     
    11711238function balanceTags( $text, $force = false ) {
    11721239    if ( $force || get_option('use_balanceTags') == 1 ) {
     1240        /**
     1241         * Filter the list of delimiters to be used before tags are balanced.
     1242         *
     1243         * @since 3.8.0
     1244         *
     1245         * @param array $delimiters An array of delimiters, e.g '<!--more.*?-->', '<!--nextpage-->'.
     1246         */
    11731247        $balance_tags_delimiters = apply_filters( 'balance_tags_delimiters', array( '<!--more.*?-->', '<!--nextpage-->' ) );
    11741248        // Capture lets PREG_SPLIT_DELIM_CAPTURE return the delimiters
     
    13261400 */
    13271401function format_to_edit( $content, $richedit = false ) {
     1402    /**
     1403     * Filter the text to be formatted for editing.
     1404     *
     1405     * @since 1.2.1
     1406     *
     1407     * @param string $content The text, prior to formatting for editing.
     1408     */
    13281409    $content = apply_filters( 'format_to_edit', $content );
    13291410    if ( ! $richedit )
     
    13411422 */
    13421423function format_to_post($content) {
    1343     $content = apply_filters('format_to_post', $content);
     1424    /**
     1425     * Filter the string returned by format_to_post().
     1426     *
     1427     * @since 1.2.1
     1428     *
     1429     * @param string $content The string to format.
     1430     */
     1431    $content = apply_filters( 'format_to_post', $content );
    13441432    return $content;
    13451433}
     
    17771865    $smiley_masked = esc_attr( $smiley );
    17781866
     1867    /**
     1868     * Filter the Smiley image URL before it's used in the image element.
     1869     *
     1870     * @since 2.9.0
     1871     *
     1872     * @param string $smiley_url URL for the smiley image.
     1873     * @param string $img        Filename for the smiley image.
     1874     * @param string $site_url   Site URL, as returned by site_url().
     1875     */
    17791876    $src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() );
    17801877
     
    18501947    // Test for the minimum length the email can be
    18511948    if ( strlen( $email ) < 3 ) {
     1949        /**
     1950         * Filter whether an email address is valid.
     1951         *
     1952         * This filter is evaluated under several different contexts, such as 'email_too_short',
     1953         * 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits',
     1954         * 'domain_no_periods', 'sub_hyphen_limits', 'sub_invalid_chars', or no specific context.
     1955         *
     1956         * @since 2.8.0
     1957         *
     1958         * @param bool   $is_email Whether the email address has passed the is_email() checks. Default false.
     1959         * @param string $email    The email address being checked.
     1960         * @param string $message  An explanatory message to the user.
     1961         * @param string $context  Context under which the email was tested.
     1962         */
    18521963        return apply_filters( 'is_email', false, $email, 'email_too_short' );
    18531964    }
     
    18551966    // Test for an @ character after the first position
    18561967    if ( strpos( $email, '@', 1 ) === false ) {
     1968        /** This filter is documented in wp-includes/formatting.php */
    18571969        return apply_filters( 'is_email', false, $email, 'email_no_at' );
    18581970    }
     
    18641976    // Test for invalid characters
    18651977    if ( !preg_match( '/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/', $local ) ) {
     1978        /** This filter is documented in wp-includes/formatting.php */
    18661979        return apply_filters( 'is_email', false, $email, 'local_invalid_chars' );
    18671980    }
     
    18701983    // Test for sequences of periods
    18711984    if ( preg_match( '/\.{2,}/', $domain ) ) {
     1985        /** This filter is documented in wp-includes/formatting.php */
    18721986        return apply_filters( 'is_email', false, $email, 'domain_period_sequence' );
    18731987    }
     
    18751989    // Test for leading and trailing periods and whitespace
    18761990    if ( trim( $domain, " \t\n\r\0\x0B." ) !== $domain ) {
     1991        /** This filter is documented in wp-includes/formatting.php */
    18771992        return apply_filters( 'is_email', false, $email, 'domain_period_limits' );
    18781993    }
     
    18831998    // Assume the domain will have at least two subs
    18841999    if ( 2 > count( $subs ) ) {
     2000        /** This filter is documented in wp-includes/formatting.php */
    18852001        return apply_filters( 'is_email', false, $email, 'domain_no_periods' );
    18862002    }
     
    18902006        // Test for leading and trailing hyphens and whitespace
    18912007        if ( trim( $sub, " \t\n\r\0\x0B-" ) !== $sub ) {
     2008            /** This filter is documented in wp-includes/formatting.php */
    18922009            return apply_filters( 'is_email', false, $email, 'sub_hyphen_limits' );
    18932010        }
     
    18952012        // Test for invalid characters
    18962013        if ( !preg_match('/^[a-z0-9-]+$/i', $sub ) ) {
     2014            /** This filter is documented in wp-includes/formatting.php */
    18972015            return apply_filters( 'is_email', false, $email, 'sub_invalid_chars' );
    18982016        }
     
    19002018
    19012019    // Congratulations your email made it!
     2020    /** This filter is documented in wp-includes/formatting.php */
    19022021    return apply_filters( 'is_email', $email, $email, null );
    19032022}
     
    20792198    // Test for the minimum length the email can be
    20802199    if ( strlen( $email ) < 3 ) {
     2200        /**
     2201         * Filter a sanitized email address.
     2202         *
     2203         * This filter is evaluated under several contexts, including 'email_too_short',
     2204         * 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits',
     2205         * 'domain_no_periods', 'domain_no_valid_subs', or no context.
     2206         *
     2207         * @since 2.8.0
     2208         *
     2209         * @param string $email   The sanitized email address.
     2210         * @param string $email   The email address, as provided to sanitize_email().
     2211         * @param string $message A message to pass to the user.
     2212         */
    20812213        return apply_filters( 'sanitize_email', '', $email, 'email_too_short' );
    20822214    }
     
    20842216    // Test for an @ character after the first position
    20852217    if ( strpos( $email, '@', 1 ) === false ) {
     2218        /** This filter is documented in wp-includes/formatting.php */
    20862219        return apply_filters( 'sanitize_email', '', $email, 'email_no_at' );
    20872220    }
     
    20942227    $local = preg_replace( '/[^a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]/', '', $local );
    20952228    if ( '' === $local ) {
     2229        /** This filter is documented in wp-includes/formatting.php */
    20962230        return apply_filters( 'sanitize_email', '', $email, 'local_invalid_chars' );
    20972231    }
     
    21012235    $domain = preg_replace( '/\.{2,}/', '', $domain );
    21022236    if ( '' === $domain ) {
     2237        /** This filter is documented in wp-includes/formatting.php */
    21032238        return apply_filters( 'sanitize_email', '', $email, 'domain_period_sequence' );
    21042239    }
     
    21072242    $domain = trim( $domain, " \t\n\r\0\x0B." );
    21082243    if ( '' === $domain ) {
     2244        /** This filter is documented in wp-includes/formatting.php */
    21092245        return apply_filters( 'sanitize_email', '', $email, 'domain_period_limits' );
    21102246    }
     
    21152251    // Assume the domain will have at least two subs
    21162252    if ( 2 > count( $subs ) ) {
     2253        /** This filter is documented in wp-includes/formatting.php */
    21172254        return apply_filters( 'sanitize_email', '', $email, 'domain_no_periods' );
    21182255    }
     
    21372274    // If there aren't 2 or more valid subs
    21382275    if ( 2 > count( $new_subs ) ) {
     2276        /** This filter is documented in wp-includes/formatting.php */
    21392277        return apply_filters( 'sanitize_email', '', $email, 'domain_no_valid_subs' );
    21402278    }
     
    21472285
    21482286    // Congratulations your email made it!
     2287    /** This filter is documented in wp-includes/formatting.php */
    21492288    return apply_filters( 'sanitize_email', $email, $email, null );
    21502289}
     
    22262365        $text = strip_shortcodes( $text );
    22272366
    2228         $text = apply_filters('the_content', $text);
     2367        /** This filter is documented in wp-includes/post-template.php */
     2368        $text = apply_filters( 'the_content', $text );
    22292369        $text = str_replace(']]>', ']]&gt;', $text);
    2230         $excerpt_length = apply_filters('excerpt_length', 55);
    2231         $excerpt_more = apply_filters('excerpt_more', ' ' . '[&hellip;]');
     2370
     2371        /**
     2372         * Filter the number of words in an excerpt.
     2373         *
     2374         * @since 2.7.0
     2375         *
     2376         * @param int $number The number of words. Default 55.
     2377         */
     2378        $excerpt_length = apply_filters( 'excerpt_length', 55 );
     2379        /**
     2380         * Filter the string in the "more" link displayed after a trimmed excerpt.
     2381         *
     2382         * @since 2.9.0
     2383         *
     2384         * @param string $more_string The string shown within the more link.
     2385         */
     2386        $excerpt_more = apply_filters( 'excerpt_more', ' ' . '[&hellip;]' );
    22322387        $text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
    22332388    }
    2234     return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
     2389    /**
     2390     * Filter the trimmed excerpt string.
     2391     *
     2392     * @since 2.8.0
     2393     *
     2394     * @param string $text        The trimmed text.
     2395     * @param string $raw_excerpt The text prior to trimming.
     2396     */
     2397    return apply_filters( 'wp_trim_excerpt', $text, $raw_excerpt );
    22352398}
    22362399
     
    22722435        $text = implode( $sep, $words_array );
    22732436    }
     2437    /**
     2438     * Filter the text content after words have been trimmed.
     2439     *
     2440     * @since 3.3.0
     2441     *
     2442     * @param string $text          The trimmed text.
     2443     * @param int    $num_words     The number of words to trim the text to. Default 5.
     2444     * @param string $more          An optional string to append to the end of the trimmed text, e.g. &hellip;.
     2445     * @param string $original_text The text before it was trimmed.
     2446     */
    22742447    return apply_filters( 'wp_trim_words', $text, $num_words, $more, $original_text );
    22752448}
     
    22852458function ent2ncr($text) {
    22862459
    2287     // Allow a plugin to short-circuit and override the mappings.
     2460    /**
     2461     * Filter text before named entities are converted into numbered entities.
     2462     *
     2463     * A non-null string must be returned for the filter to be evaluated.
     2464     *
     2465     * @since 3.3.0
     2466     *
     2467     * @param null   $converted_text The text to be converted. Default null.
     2468     * @param string $text           The text prior to entity conversion.
     2469     */
    22882470    $filtered = apply_filters( 'pre_ent2ncr', null, $text );
    22892471    if( null !== $filtered )
     
    25642746 */
    25652747function wp_richedit_pre($text) {
    2566     // Filtering a blank results in an annoying <br />\n
    2567     if ( empty($text) ) return apply_filters('richedit_pre', '');
     2748    if ( empty( $text ) ) {
     2749        /**
     2750         * Filter text returned for the rich text editor.
     2751         *
     2752         * This filter is first evaluated, and the value returned, if an empty string
     2753         * is passed to wp_richedit_pre(). If an empty string is passed, it results
     2754         * in a break tag and line feed.
     2755         *
     2756         * If a non-empty string is passed, the filter is evaluated on the wp_richedit_pre()
     2757         * return after being formatted.
     2758         *
     2759         * @since 2.0.0
     2760         *
     2761         * @param string $output Text for the rich text editor.
     2762         */
     2763        return apply_filters( 'richedit_pre', '' );
     2764    }
    25682765
    25692766    $output = convert_chars($text);
     
    25712768    $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) );
    25722769
    2573     return apply_filters('richedit_pre', $output);
     2770    /** This filter is documented in wp-includes/formatting.php */
     2771    return apply_filters( 'richedit_pre', $output );
    25742772}
    25752773
     
    25892787        $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // convert only < > &
    25902788
    2591     return apply_filters('htmledit_pre', $output);
     2789    /**
     2790     * Filter the text before it is formatted for the HTML editor.
     2791     *
     2792     * @since 2.5.0
     2793     *
     2794     * @param string $output The HTML-formatted text.
     2795     */
     2796    return apply_filters( 'htmledit_pre', $output );
    25922797}
    25932798
     
    26842889    }
    26852890
    2686     return apply_filters('clean_url', $good_protocol_url, $original_url, $_context);
     2891    /**
     2892     * Filter a string cleaned and escaped for output as a URL.
     2893     *
     2894     * @since 2.3.0
     2895     *
     2896     * @param string $good_protocol_url The cleaned URL to be returned.
     2897     * @param string $original_url      The URL prior to cleaning.
     2898     * @param string $_context          If 'display', replace ampersands and single quotes only.
     2899     */
     2900    return apply_filters( 'clean_url', $good_protocol_url, $original_url, $_context );
    26872901}
    26882902
     
    27352949    $safe_text = str_replace( "\r", '', $safe_text );
    27362950    $safe_text = str_replace( "\n", '\\n', addslashes( $safe_text ) );
     2951    /**
     2952     * Filter a string cleaned and escaped for output in JavaScript.
     2953     *
     2954     * Text passed to esc_js() is stripped of invalid or special characters,
     2955     * and properly slashed for output.
     2956     *
     2957     * @since 2.0.11
     2958     *
     2959     * @param string $safe_text The text after it has been escaped.
     2960     * @param string $text      The text prior to being escaped.
     2961     */
    27372962    return apply_filters( 'js_escape', $safe_text, $text );
    27382963}
     
    27492974    $safe_text = wp_check_invalid_utf8( $text );
    27502975    $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
     2976    /**
     2977     * Filter a string cleaned and escaped for output in HTML.
     2978     *
     2979     * Text passed to esc_html() is stripped of invalid or special characters
     2980     * before output.
     2981     *
     2982     * @since 2.8.0
     2983     *
     2984     * @param string $safe_text The text after it has been escaped.
     2985     * @param string $text      The text prior to being escaped.
     2986     */
    27512987    return apply_filters( 'esc_html', $safe_text, $text );
    27522988}
     
    27632999    $safe_text = wp_check_invalid_utf8( $text );
    27643000    $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
     3001    /**
     3002     * Filter a string cleaned and escaped for output in an HTML attribute.
     3003     *
     3004     * Text passed to esc_attr() is stripped of invalid or special characters
     3005     * before output.
     3006     *
     3007     * @since 2.0.11
     3008     *
     3009     * @param string $safe_text The text after it has been escaped.
     3010     * @param string $text      The text prior to being escaped.
     3011     */
    27653012    return apply_filters( 'attribute_escape', $safe_text, $text );
    27663013}
     
    27763023function esc_textarea( $text ) {
    27773024    $safe_text = htmlspecialchars( $text, ENT_QUOTES, get_option( 'blog_charset' ) );
     3025    /**
     3026     * Filter a string cleaned and escaped for output in a textarea element.
     3027     *
     3028     * @since 3.1.0
     3029     *
     3030     * @param string $safe_text The text after it has been escaped.
     3031     * @param string $text      The text prior to being escaped.
     3032     */
    27783033    return apply_filters( 'esc_textarea', $safe_text, $text );
    27793034}
     
    27893044function tag_escape($tag_name) {
    27903045    $safe_tag = strtolower( preg_replace('/[^a-zA-Z0-9_:]/', '', $tag_name) );
    2791     return apply_filters('tag_escape', $safe_tag, $tag_name);
     3046    /**
     3047     * Filter a string cleaned and escaped for output as an HTML tag.
     3048     *
     3049     * @since 2.8.0
     3050     *
     3051     * @param string $safe_tag The tag name after it has been escaped.
     3052     * @param string $tag_name The text before it was escaped.
     3053     */
     3054    return apply_filters( 'tag_escape', $safe_tag, $tag_name );
    27923055}
    27933056
     
    29953258    }
    29963259
    2997     $value = apply_filters("sanitize_option_{$option}", $value, $option);
     3260    /**
     3261     * Filter an option value following sanitization.
     3262     *
     3263     * @since 2.3.0
     3264     *
     3265     * @param string $value  The sanitized option value.
     3266     * @param string $option The option name.
     3267     */
     3268    $value = apply_filters( "sanitize_option_{$option}", $value, $option );
    29983269
    29993270    return $value;
     
    30073278 *
    30083279 * @since 2.2.1
    3009  * @uses apply_filters() for the 'wp_parse_str' filter.
    30103280 *
    30113281 * @param string $string The string to be parsed.
     
    30163286    if ( get_magic_quotes_gpc() )
    30173287        $array = stripslashes_deep( $array );
     3288    /**
     3289     * Filter the array of variables derived from a parsed string.
     3290     *
     3291     * @since 2.3.0
     3292     *
     3293     * @param array $array The array populated with variables.
     3294     */
    30183295    $array = apply_filters( 'wp_parse_str', $array );
    30193296}
     
    30963373            }
    30973374
    3098             // Apply filters OR sprintf
     3375            /**
     3376             * Filter a fragment from the pattern passed to wp_sprintf().
     3377             *
     3378             * If the fragment is unchanged, then sprintf() will be run on the fragment.
     3379             *
     3380             * @since 2.5.0
     3381             *
     3382             * @param string $fragment A fragment from the pattern.
     3383             * @param string $arg      The argument.
     3384             */
    30993385            $_fragment = apply_filters( 'wp_sprintf', $fragment, $arg );
    31003386            if ( $_fragment != $fragment )
     
    31333419        return '';
    31343420
    3135     // Translate and filter the delimiter set (avoid ampersands and entities here)
    3136     $l = apply_filters('wp_sprintf_l', array(
     3421    /**
     3422     * Filter the translated delimiters used by wp_sprintf_l().
     3423     *
     3424     * Please note: Ampersands and entities should be avoided here.
     3425     *
     3426     * @since 2.5.0
     3427     *
     3428     * @param array $delimiters An array of translated delimiters.
     3429     */
     3430    $l = apply_filters( 'wp_sprintf_l', array(
    31373431        /* translators: used between list items, there is a space after the comma */
    31383432        'between'          => __(', '),
     
    31413435        /* translators: used between only two list items, there is a space after the and */
    31423436        'between_only_two' => __(' and '),
    3143         ));
     3437    ) );
    31443438
    31453439    $args = (array) $args;
     
    33333627    }
    33343628
    3335     return apply_filters('sanitize_text_field', $filtered, $str);
     3629    /**
     3630     * Filter a sanitized text field string.
     3631     *
     3632     * @since 2.9.0
     3633     *
     3634     * @param string $filtered The sanitized string.
     3635     * @param string $str      The string prior to being sanitized.
     3636     */
     3637    return apply_filters( 'sanitize_text_field', $filtered, $str );
    33363638}
    33373639
     
    33823684function sanitize_mime_type( $mime_type ) {
    33833685    $sani_mime_type = preg_replace( '/[^-+*.a-zA-Z0-9\/]/', '', $mime_type );
     3686    /**
     3687     * Filter a mime type following sanitization.
     3688     *
     3689     * @since 3.1.3
     3690     *
     3691     * @param string $sani_mime_type The sanitized mime type.
     3692     * @param string $mime_type      The mime type prior to sanitization.
     3693     */
    33843694    return apply_filters( 'sanitize_mime_type', $sani_mime_type, $mime_type );
    33853695}
     
    34013711    $urls_to_ping = array_map( 'esc_url_raw', $urls_to_ping );
    34023712    $urls_to_ping = implode( "\n", $urls_to_ping );
     3713    /**
     3714     * Filter a list of trackback URLs following sanitization.
     3715     *
     3716     * The string returned here consists of a space or carriage return-delimited list
     3717     * of trackback URLs.
     3718     *
     3719     * @since 3.4.0
     3720     *
     3721     * @param string $urls_to_ping Sanitized space or carriage return separated URLs.
     3722     * @param string $to_ping      Space or carriage return separated URLs before sanitization.
     3723     */
    34033724    return apply_filters( 'sanitize_trackback_urls', $urls_to_ping, $to_ping );
    34043725}
Note: See TracChangeset for help on using the changeset viewer.