WordPress.org

Make WordPress Core

Ticket #25518: 25518.diff

File 25518.diff, 20.9 KB (added by simonwheatley, 6 years ago)

Hook documentation for wp-includes/formatting.php

  • src/wp-includes/formatting.php

     
    101101
    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        /**
     105         * Filter the list of HTML elements which are not texturised.
     106         *
     107         * Long description.
     108         *
     109         * @since 2.8
     110         *
     111         * @param array $default_no_texturize_tags An array of HTML element names
     112         */
    104113        $no_texturize_tags = '(' . implode('|', apply_filters('no_texturize_tags', $default_no_texturize_tags) ) . ')';
     114        /**
     115         * Filter the shortcodes which are not texturised.
     116         *
     117         * @since 2.8
     118         *
     119         * @param array $no_texturise_shortcodes An array of shortcode names
     120         */
    105121        $no_texturize_shortcodes = '(' . implode('|', apply_filters('no_texturize_shortcodes', $default_no_texturize_shortcodes) ) . ')';
    106122
    107123        $no_texturize_tags_stack = array();
     
    842858function sanitize_file_name( $filename ) {
    843859        $filename_raw = $filename;
    844860        $special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", chr(0));
     861        /**
     862         * Filter the characters to remove from a filename.
     863         *
     864         * @since 2.8
     865         *
     866         * @param array $special_chars The characters to remove
     867         * @param string $filename_raw The filename as it was passed into sanitize_file_name
     868         */
    845869        $special_chars = apply_filters('sanitize_file_name_chars', $special_chars, $filename_raw);
    846870        $filename = str_replace($special_chars, '', $filename);
    847871        $filename = preg_replace('/[\s-]+/', '-', $filename);
     
    851875        $parts = explode('.', $filename);
    852876
    853877        // Return if only one extension
    854         if ( count($parts) <= 2 )
     878        if ( count($parts) <= 2 ) {
     879                /**
     880                 * Filter the string returned by sanitize_file_name. The string
     881                 * has been sanitized for use as a file name.
     882                 *
     883                 * @since 2.8
     884                 *
     885                 * @param string $filename The sanitized filename.
     886                 * @param string $filename_raw The filename before sanitization.
     887                 */
    855888                return apply_filters('sanitize_file_name', $filename, $filename_raw);
     889        }
    856890
    857891        // Process multiple extensions
    858892        $filename = array_shift($parts);
     
    878912                }
    879913        }
    880914        $filename .= '.' . $extension;
    881 
     915        //duplicate hook
    882916        return apply_filters('sanitize_file_name', $filename, $filename_raw);
    883917}
    884918
     
    891925 * parameters for the 'sanitize_user' filter.
    892926 *
    893927 * @since 2.0.0
    894  * @uses apply_filters() Calls 'sanitize_user' hook on username, raw username,
    895  *              and $strict parameter.
    896928 *
    897929 * @param string $username The username to be sanitized.
    898930 * @param bool $strict If set limits $username to specific characters. Default false.
     
    914946        // Consolidate contiguous whitespace
    915947        $username = preg_replace( '|\s+|', ' ', $username );
    916948
     949        /**
     950         * Filter the string returned by sanitize_user. The string has been
     951         * sanitized for use as a username.
     952         *
     953         * @since 2.0.11
     954         *
     955         * @param string $username The sanitized username.
     956         * @param string $raw_username The username before sanitization.
     957         * @param bool $strict Whether to limity the sanitization to specific characters.
     958         */
    917959        return apply_filters( 'sanitize_user', $username, $raw_username, $strict );
    918960}
    919961
     
    931973        $raw_key = $key;
    932974        $key = strtolower( $key );
    933975        $key = preg_replace( '/[^a-z0-9_\-]/', '', $key );
     976
     977        /**
     978         * Filter the string returned by sanitize_key. The string
     979         * has been sanitized for use as a key.
     980         *
     981         * @since 3.0
     982         *
     983         * @param string $key The sanitized key.
     984         * @param string $raw_key The key before sanitization.
     985         */
    934986        return apply_filters( 'sanitize_key', $key, $raw_key );
    935987}
    936988
     
    9541006        if ( 'save' == $context )
    9551007                $title = remove_accents($title);
    9561008
     1009        /**
     1010         * Filter the sanitized title.
     1011         *
     1012         * @since 1.2.1
     1013         *
     1014         * @param string $title The sanitized title.
     1015         * @param string $raw_title The title before sanitization.
     1016         * @param string $context The operation for which the title is being sanitized.
     1017         */
    9571018        $title = apply_filters('sanitize_title', $title, $raw_title, $context);
    9581019
    9591020        if ( '' === $title || false === $title )
     
    10861147        if ( '' == $sanitized )
    10871148                $sanitized = $fallback;
    10881149
     1150        /**
     1151         * Filter the string returned by sanitize_html_class. The string has been
     1152         * sanitized for use as a HTML class.
     1153         *
     1154         * @since 2.8
     1155         *
     1156         * @param string $sanitized The sanitized HTML class.
     1157         * @param string $class The HTML class before sanitization.
     1158         * @param string $fallback The fallback provided.
     1159         */
    10891160        return apply_filters( 'sanitize_html_class', $sanitized, $class, $fallback );
    10901161}
    10911162
     
    11701241 */
    11711242function balanceTags( $text, $force = false ) {
    11721243        if ( $force || get_option('use_balanceTags') == 1 ) {
    1173                 $balance_tags_delimiters = apply_filters( 'balance_tags_delimiters', array( '<!--more.*?-->', '<!--nextpage-->' ) );
     1244                $delimiters = array( '<!--more.*?-->', '<!--nextpage-->' );
     1245                /**
     1246                 * Filter the delimiters to be used before tags are balanced.
     1247                 *
     1248                 * @since 3.8
     1249                 * @param array $delimiters An array of delimiters, e.g '<!--more.*?-->'
     1250                 */
     1251                $balance_tags_delimiters = apply_filters( 'balance_tags_delimiters', $delimiters );
    11741252                // Capture lets PREG_SPLIT_DELIM_CAPTURE return the delimiters
    11751253                $delimiters_regex = '/(' . implode( '|', $balance_tags_delimiters ) . ')/';
    11761254                $parts = preg_split( $delimiters_regex, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
     
    13251403 * @return string The text after the filter (and possibly htmlspecialchars()) has been run.
    13261404 */
    13271405function format_to_edit( $content, $richedit = false ) {
     1406        /**
     1407         * Filter the text to be formatted for editing.
     1408         *
     1409         * @since 1.2.1
     1410         *
     1411         * @param string $content The text, before formatting for editing.
     1412         */
    13281413        $content = apply_filters( 'format_to_edit', $content );
    13291414        if ( ! $richedit )
    13301415                $content = esc_textarea( $content );
     
    13401425 * @return string Text returned from the 'format_to_post' filter.
    13411426 */
    13421427function format_to_post($content) {
     1428        /**
     1429         * Filter the string returned by format_to_post.
     1430         *
     1431         * @since 1.2.1
     1432         *
     1433         * @param string $content The string to format.
     1434         */
    13431435        $content = apply_filters('format_to_post', $content);
    13441436        return $content;
    13451437}
     
    17751867        $smiley = trim( reset( $matches ) );
    17761868        $img = $wpsmiliestrans[ $smiley ];
    17771869        $smiley_masked = esc_attr( $smiley );
     1870        $smiley_url = includes_url( "images/smilies/$img" );
     1871        $site_url = site_url();
    17781872
    1779         $src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() );
     1873        /**
     1874         * Filter the URL for the Smiley image before it's used in the
     1875         * IMG element.
     1876         *
     1877         * @since 2.9
     1878         *
     1879         * @param string $smiley_url The URL for the smiley image.
     1880         * @param string $img The filename for the smiley image.
     1881         * @param string $site_url The site URL, as returned by site_url().
     1882         */     
     1883        $src_url = apply_filters( 'smilies_src', $smiley_url, $img, $site_url );
    17801884
    17811885        return " <img src='$src_url' alt='$smiley_masked' class='wp-smiley' /> ";
    17821886}
     
    18491953
    18501954        // Test for the minimum length the email can be
    18511955        if ( strlen( $email ) < 3 ) {
     1956                /**
     1957                 * Filter the boolean before it is returned
     1958                 * by is_email.
     1959                 *
     1960                 * @since 2.8
     1961                 *
     1962                 * @param boolean $is_email     True if the email address has passed is_email() function checks.
     1963                 * @param string $email The email address being checked.
     1964                 * @param string $message An explanatory message to the user.
     1965                 *
     1966                 */
    18521967                return apply_filters( 'is_email', false, $email, 'email_too_short' );
    18531968        }
    18541969
    18551970        // Test for an @ character after the first position
    18561971        if ( strpos( $email, '@', 1 ) === false ) {
     1972                //duplicate_hook
    18571973                return apply_filters( 'is_email', false, $email, 'email_no_at' );
    18581974        }
    18591975
     
    18631979        // LOCAL PART
    18641980        // Test for invalid characters
    18651981        if ( !preg_match( '/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/', $local ) ) {
     1982                //duplicate_hook
    18661983                return apply_filters( 'is_email', false, $email, 'local_invalid_chars' );
    18671984        }
    18681985
    18691986        // DOMAIN PART
    18701987        // Test for sequences of periods
    18711988        if ( preg_match( '/\.{2,}/', $domain ) ) {
     1989                //duplicate_hook
    18721990                return apply_filters( 'is_email', false, $email, 'domain_period_sequence' );
    18731991        }
    18741992
    18751993        // Test for leading and trailing periods and whitespace
    18761994        if ( trim( $domain, " \t\n\r\0\x0B." ) !== $domain ) {
     1995                //duplicate_hook
    18771996                return apply_filters( 'is_email', false, $email, 'domain_period_limits' );
    18781997        }
    18791998
     
    18822001
    18832002        // Assume the domain will have at least two subs
    18842003        if ( 2 > count( $subs ) ) {
     2004                //duplicate_hook
    18852005                return apply_filters( 'is_email', false, $email, 'domain_no_periods' );
    18862006        }
    18872007
     
    18892009        foreach ( $subs as $sub ) {
    18902010                // Test for leading and trailing hyphens and whitespace
    18912011                if ( trim( $sub, " \t\n\r\0\x0B-" ) !== $sub ) {
     2012                        //duplicate_hook
    18922013                        return apply_filters( 'is_email', false, $email, 'sub_hyphen_limits' );
    18932014                }
    18942015
    18952016                // Test for invalid characters
    18962017                if ( !preg_match('/^[a-z0-9-]+$/i', $sub ) ) {
     2018                        //duplicate_hook
    18972019                        return apply_filters( 'is_email', false, $email, 'sub_invalid_chars' );
    18982020                }
    18992021        }
    19002022
    19012023        // Congratulations your email made it!
     2024        //duplicate_hook
    19022025        return apply_filters( 'is_email', $email, $email, null );
    19032026}
    19042027
     
    20782201function sanitize_email( $email ) {
    20792202        // Test for the minimum length the email can be
    20802203        if ( strlen( $email ) < 3 ) {
     2204                /**
     2205                 * Filter the string returned by sanitize_email. The string
     2206                 * has been sanitized for use as an email address.
     2207                 *
     2208                 * @since 2.8
     2209                 *
     2210                 * @param string $email The sanitized email address.
     2211                 * @param string $email The email address, as provided to santize_email().
     2212                 * @param string $message A message to pass to the user.
     2213                 */
    20812214                return apply_filters( 'sanitize_email', '', $email, 'email_too_short' );
    20822215        }
    20832216
    20842217        // Test for an @ character after the first position
    20852218        if ( strpos( $email, '@', 1 ) === false ) {
     2219                //duplicate_hook
    20862220                return apply_filters( 'sanitize_email', '', $email, 'email_no_at' );
    20872221        }
    20882222
     
    20932227        // Test for invalid characters
    20942228        $local = preg_replace( '/[^a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]/', '', $local );
    20952229        if ( '' === $local ) {
     2230                //duplicate_hook
    20962231                return apply_filters( 'sanitize_email', '', $email, 'local_invalid_chars' );
    20972232        }
    20982233
     
    21002235        // Test for sequences of periods
    21012236        $domain = preg_replace( '/\.{2,}/', '', $domain );
    21022237        if ( '' === $domain ) {
     2238                //duplicate_hook
    21032239                return apply_filters( 'sanitize_email', '', $email, 'domain_period_sequence' );
    21042240        }
    21052241
    21062242        // Test for leading and trailing periods and whitespace
    21072243        $domain = trim( $domain, " \t\n\r\0\x0B." );
    21082244        if ( '' === $domain ) {
     2245                //duplicate_hook
    21092246                return apply_filters( 'sanitize_email', '', $email, 'domain_period_limits' );
    21102247        }
    21112248
     
    21142251
    21152252        // Assume the domain will have at least two subs
    21162253        if ( 2 > count( $subs ) ) {
     2254                //duplicate_hook
    21172255                return apply_filters( 'sanitize_email', '', $email, 'domain_no_periods' );
    21182256        }
    21192257
     
    21362274
    21372275        // If there aren't 2 or more valid subs
    21382276        if ( 2 > count( $new_subs ) ) {
     2277                //duplicate_hook
    21392278                return apply_filters( 'sanitize_email', '', $email, 'domain_no_valid_subs' );
    21402279        }
    21412280
     
    21462285        $email = $local . '@' . $domain;
    21472286
    21482287        // Congratulations your email made it!
     2288        //duplicate_hook
    21492289        return apply_filters( 'sanitize_email', $email, $email, null );
    21502290}
    21512291
     
    22252365
    22262366                $text = strip_shortcodes( $text );
    22272367
     2368                //duplicate_filter
    22282369                $text = apply_filters('the_content', $text);
    22292370                $text = str_replace(']]>', ']]&gt;', $text);
     2371
     2372                /**
     2373                 * Filter the number of characters in an excerpt.
     2374                 *
     2375                 * @since 2.7
     2376                 *
     2377                 * @param int $number The number of characters.
     2378                 */
    22302379                $excerpt_length = apply_filters('excerpt_length', 55);
     2380                /**
     2381                 * Filter the "more" string within the more link shown at the
     2382                 * end of a trimmed excerpt.
     2383                 *
     2384                 * @since 2.9
     2385                 *
     2386                 * @param string $more_string The string shown within the more link.
     2387                 */
    22312388                $excerpt_more = apply_filters('excerpt_more', ' ' . '[&hellip;]');
    22322389                $text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
    22332390        }
     2391        /**
     2392         * Filter the string returned by wp_trim_excerpt.
     2393         *
     2394         * @since 2.8
     2395         *
     2396         * @param string $text The trimmed text.
     2397         * @param string $raw_excerpt The text before trimming.
     2398         */
    22342399        return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
    22352400}
    22362401
     
    22712436        } else {
    22722437                $text = implode( $sep, $words_array );
    22732438        }
     2439        /**
     2440         * Filter the string returned by wp_trim_words.
     2441         *
     2442         * @since 3.3
     2443         *
     2444         * @param string $text The trimmed text.
     2445         * @param integer $num_words The number of words to trim the text to.
     2446         * @param string $more An optional string to append to the end of the trimmed text, e.g. &hellip;.
     2447         * @param string $original_text The text before it was trimmed.
     2448         */
    22742449        return apply_filters( 'wp_trim_words', $text, $num_words, $more, $original_text );
    22752450}
    22762451
     
    22842459 */
    22852460function ent2ncr($text) {
    22862461
    2287         // Allow a plugin to short-circuit and override the mappings.
     2462        /**
     2463         * A filter which shortcircuits the main function logic
     2464         * by providing the value to be returned.
     2465         *
     2466         * @since 3.3
     2467         *
     2468         * @param null $converted_text A null value, to be replaced with converted text.
     2469         * @param string $text The text before conversion.
     2470         */
    22882471        $filtered = apply_filters( 'pre_ent2ncr', null, $text );
    22892472        if( null !== $filtered )
    22902473                return $filtered;
     
    25642747 */
    25652748function wp_richedit_pre($text) {
    25662749        // Filtering a blank results in an annoying <br />\n
    2567         if ( empty($text) ) return apply_filters('richedit_pre', '');
     2750        if ( empty($text) ) {
     2751                /**
     2752                 * Filter the string returned by wp_richexit_pre. The
     2753                 * string has been formatted for a rich text editor.
     2754                 *
     2755                 * @since 2.0
     2756                 *
     2757                 * @param string $output The formatted text.
     2758                 */
     2759                return apply_filters('richedit_pre', '');
     2760        }
    25682761
    25692762        $output = convert_chars($text);
    25702763        $output = wpautop($output);
    25712764        $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) );
    25722765
     2766        //duplicate_filter
    25732767        return apply_filters('richedit_pre', $output);
    25742768}
    25752769
     
    25882782        if ( !empty($output) )
    25892783                $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // convert only < > &
    25902784
     2785        /**
     2786         * Filter the string returned by wp_htmledit_pre. The string
     2787         * has been formatted for the HTML editor.
     2788         *
     2789         * @since 2.5
     2790         *
     2791         * @param string $output The formatted text.
     2792         */
    25912793        return apply_filters('htmledit_pre', $output);
    25922794}
    25932795
     
    26832885                        return '';
    26842886        }
    26852887
     2888        /**
     2889         * Filter the string returned by clean_url. The string has been
     2890         * cleaned for use as a URL.
     2891         *
     2892         * @since 2.3
     2893         *
     2894         * @param string $good_protocol_url The cleaned URL to be returned.
     2895         * @param string $original_url The URL before cleaning.
     2896         * @param string $_context If 'display', replace ampersands and single quotes only.
     2897         */
    26862898        return apply_filters('clean_url', $good_protocol_url, $original_url, $_context);
    26872899}
    26882900
     
    27342946        $safe_text = preg_replace( '/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes( $safe_text ) );
    27352947        $safe_text = str_replace( "\r", '', $safe_text );
    27362948        $safe_text = str_replace( "\n", '\\n', addslashes( $safe_text ) );
     2949        /**
     2950         * Filter the string returned by esc_js. The string has been
     2951         * escaped for JS.
     2952         *
     2953         * @since 2.7
     2954         *
     2955         * @param string $safe_text The text after it has been escaped.
     2956         * @param string $text The text before it was escaped.
     2957         */
    27372958        return apply_filters( 'js_escape', $safe_text, $text );
    27382959}
    27392960
     
    27482969function esc_html( $text ) {
    27492970        $safe_text = wp_check_invalid_utf8( $text );
    27502971        $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
     2972        /**
     2973         * Filter the string returned by esc_html. The string has been
     2974         * escaped for HTML blocks.
     2975         *
     2976         * @since 2.7
     2977         *
     2978         * @param string $safe_text The text after it has been escaped.
     2979         * @param string $text The text before it was escaped.
     2980         */
    27512981        return apply_filters( 'esc_html', $safe_text, $text );
    27522982}
    27532983
     
    27622992function esc_attr( $text ) {
    27632993        $safe_text = wp_check_invalid_utf8( $text );
    27642994        $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
     2995        /**
     2996         * Filter the string returned by esc_attr. The string has
     2997         * been escaped for use in HTML attributes.
     2998         *
     2999         * @since 2.7
     3000         *
     3001         * @param string $safe_text The text after it has been escaped.
     3002         * @param string $text The text before it was escaped.
     3003         */
    27653004        return apply_filters( 'attribute_escape', $safe_text, $text );
    27663005}
    27673006
     
    27753014 */
    27763015function esc_textarea( $text ) {
    27773016        $safe_text = htmlspecialchars( $text, ENT_QUOTES, get_option( 'blog_charset' ) );
     3017        /**
     3018         * Filter the string returned by esc_textarea. The string has been
     3019         * escaped for text areas.
     3020         *
     3021         * @since 3.1
     3022         *
     3023         * @param string $safe_text The text after it has been escaped.
     3024         * @param string $text The text before it was escaped.
     3025         */
    27783026        return apply_filters( 'esc_textarea', $safe_text, $text );
    27793027}
    27803028
     
    27883036 */
    27893037function tag_escape($tag_name) {
    27903038        $safe_tag = strtolower( preg_replace('/[^a-zA-Z0-9_:]/', '', $tag_name) );
     3039        /**
     3040         * Filter the string returned by tag_escape. The string has been
     3041         * escaped as an HTML tag name.
     3042         *
     3043         * @since 2.8
     3044         *
     3045         * @param string $safe_tag The tag name after it's been escaped.
     3046         * @param string $tag_name The text before it was escaped.
     3047         */
    27913048        return apply_filters('tag_escape', $safe_tag, $tag_name);
    27923049}
    27933050
     
    29943251                        break;
    29953252        }
    29963253
     3254        /**
     3255         * Filter the string returned by sanitize_option. The string has been
     3256         * sanitized for the specified option.
     3257         *
     3258         * @since 3.2.1
     3259         *
     3260         * @param string $value The sanitized value.
     3261         * @param string $option The option name.
     3262         */
    29973263        $value = apply_filters("sanitize_option_{$option}", $value, $option);
    29983264
    29993265        return $value;
     
    30063272 * {@link http://www.php.net/magic_quotes magic_quotes_gpc} is on.
    30073273 *
    30083274 * @since 2.2.1
    3009  * @uses apply_filters() for the 'wp_parse_str' filter.
    30103275 *
    30113276 * @param string $string The string to be parsed.
    30123277 * @param array $array Variables will be stored in this array.
     
    30153280        parse_str( $string, $array );
    30163281        if ( get_magic_quotes_gpc() )
    30173282                $array = stripslashes_deep( $array );
     3283        /**
     3284         * Filter the array populated with variables
     3285         * from a string by wp_parse_str.
     3286         *
     3287         * @since 2.2.1
     3288         *
     3289         * @param array The array populated with variables
     3290         */
    30183291        $array = apply_filters( 'wp_parse_str', $array );
    30193292}
    30203293
     
    30963369                        }
    30973370
    30983371                        // Apply filters OR sprintf
     3372                        /**
     3373                         * Filter a fragment from the pattern passed to wp_sprintf,
     3374                         * if the fragment is unchanged then sprintf will be run
     3375                         * on the fragment.
     3376                         *
     3377                         * @since 2.5
     3378                         *
     3379                         * @param string $fragment A fragment from the pattern.
     3380                         * @param string $arg The argument.
     3381                         */
    30993382                        $_fragment = apply_filters( 'wp_sprintf', $fragment, $arg );
    31003383                        if ( $_fragment != $fragment )
    31013384                                $fragment = $_fragment;
     
    31333416                return '';
    31343417
    31353418        // Translate and filter the delimiter set (avoid ampersands and entities here)
    3136         $l = apply_filters('wp_sprintf_l', array(
     3419        $l = array(
    31373420                /* translators: used between list items, there is a space after the comma */
    31383421                'between'          => __(', '),
    31393422                /* translators: used between list items, there is a space after the and */
    31403423                'between_last_two' => __(', and '),
    31413424                /* translators: used between only two list items, there is a space after the and */
    31423425                'between_only_two' => __(' and '),
    3143                 ));
     3426        );
     3427        /**
     3428         * Filter the translated delimiters used by wp_sprintf_l.
     3429         *
     3430         * @since 2.5
     3431         *
     3432         * @param array $delimiters The translated delimiters
     3433         */
     3434        $l = apply_filters('wp_sprintf_l', $l);
    31443435
    31453436        $args = (array) $args;
    31463437        $result = array_shift($args);
     
    33323623                $filtered = trim( preg_replace('/ +/', ' ', $filtered) );
    33333624        }
    33343625
     3626        /**
     3627         * Filter the string returned by sanitize_text_field. The string
     3628         * has been sanitized for text fields.
     3629         *
     3630         * @since 2.9
     3631         *
     3632         * @param string $filtered The sanitized string
     3633         * @param string $str The string before it was sanitized
     3634         */
    33353635        return apply_filters('sanitize_text_field', $filtered, $str);
    33363636}
    33373637
     
    33813681 */
    33823682function sanitize_mime_type( $mime_type ) {
    33833683        $sani_mime_type = preg_replace( '/[^-+*.a-zA-Z0-9\/]/', '', $mime_type );
     3684        /**
     3685         * Filter the string returned by sanitize_mime_type. The string has
     3686         * been sanitized for use as a mime_type.
     3687         *
     3688         * @since 3.2
     3689         *
     3690         * @param string $sani_mime_type The sanitized mime type
     3691         * @param string $mime_type The mime type before sanitization
     3692         */
    33843693        return apply_filters( 'sanitize_mime_type', $sani_mime_type, $mime_type );
    33853694}
    33863695
     
    34003709        }
    34013710        $urls_to_ping = array_map( 'esc_url_raw', $urls_to_ping );
    34023711        $urls_to_ping = implode( "\n", $urls_to_ping );
     3712        /**
     3713         * Filter the string returned by sanitize_trackback_urls. The string is a
     3714         * space separated list of HTTP or HTTPS URLs.
     3715         *
     3716         * @since 3.4
     3717         *
     3718         * @param string $urls_to_ping Sanitized space or carriage return separated URLs
     3719         * @param string $to_ping Space or carriage return separated URLs before sanitization
     3720         */
    34033721        return apply_filters( 'sanitize_trackback_urls', $urls_to_ping, $to_ping );
    34043722}
    34053723