Make WordPress Core

Changeset 52810


Ignore:
Timestamp:
02/28/2022 04:01:47 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Docs: Use third-person singular verbs for function descriptions in wp-includes/formatting.php, per the documentation standards.

See #54729.

File:
1 edited

Legend:

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

    r52809 r52810  
    372372
    373373/**
    374  * Search for disabled element tags. Push element to stack on tag open and pop
    375  * on tag close.
     374 * Searches for disabled element tags. Pushes element to stack on tag open
     375 * and pops on tag close.
    376376 *
    377377 * Assumes first char of $text is tag opening and last char is tag closing.
     
    602602
    603603/**
    604  * Separate HTML elements and comments from the text.
     604 * Separates HTML elements and comments from the text.
    605605 *
    606606 * @since 4.2.4
     
    614614
    615615/**
    616  * Retrieve the regular expression for an HTML element.
     616 * Retrieves the regular expression for an HTML element.
    617617 *
    618618 * @since 4.4.0
     
    670670
    671671/**
    672  * Retrieve the combined regular expression for HTML and shortcodes.
     672 * Retrieves the combined regular expression for HTML and shortcodes.
    673673 *
    674674 * @access private
     
    677677 * @since 4.4.0
    678678 *
    679  * @param string $shortcode_regex The result from _get_wptexturize_shortcode_regex(). Optional.
     679 * @param string $shortcode_regex Optional. The result from _get_wptexturize_shortcode_regex().
    680680 * @return string The regular expression
    681681 */
     
    713713
    714714/**
    715  * Retrieve the regular expression for shortcodes.
     715 * Retrieves the regular expression for shortcodes.
    716716 *
    717717 * @access private
     
    743743
    744744/**
    745  * Replace characters or phrases within HTML elements only.
     745 * Replaces characters or phrases within HTML elements only.
    746746 *
    747747 * @since 4.2.3
     
    794794
    795795/**
    796  * Newline preservation help function for wpautop
     796 * Newline preservation help function for wpautop().
    797797 *
    798798 * @since 3.1.0
     
    807807
    808808/**
    809  * Don't auto-p wrap shortcodes that stand alone
     809 * Don't auto-p wrap shortcodes that stand alone.
    810810 *
    811811 * Ensures that shortcodes are not wrapped in `<p>...</p>`.
     
    11361136
    11371137/**
    1138  * Encode the Unicode values to be used in the URI.
     1138 * Encodes the Unicode values to be used in the URI.
    11391139 *
    11401140 * @since 1.5.0
     
    19351935         * German has various locales (de_DE, de_CH, de_AT, ...) with formal and informal variants.
    19361936         * There is no 3-letter locale like 'def', so checking for 'de' instead of 'de_' is safe,
    1937          * since 'de' itself would be a valid locale too).
     1937         * since 'de' itself would be a valid locale too.
    19381938         */
    19391939        if ( str_starts_with( $locale, 'de' ) ) {
     
    29852985
    29862986/**
    2987  * Convert plaintext URI to HTML links.
     2987 * Converts plaintext URI to HTML links.
    29882988 *
    29892989 * Converts URI, www and ftp, and email addresses. Finishes by fixing links
     
    30573057/**
    30583058 * Breaks a string into chunks by splitting at whitespace characters.
     3059 *
    30593060 * The length of each returned chunk is as close to the specified length goal as possible,
    30603061 * with the caveat that each chunk includes its trailing delimiter.
     
    33463347
    33473348/**
    3348  * Convert one smiley code to the icon graphic file equivalent.
     3349 * Converts one smiley code to the icon graphic file equivalent.
    33493350 *
    33503351 * Callback handler for convert_smilies().
     
    33943395
    33953396/**
    3396  * Convert text equivalent of smilies to images.
     3397 * Converts text equivalent of smilies to images.
    33973398 *
    33983399 * Will only convert smilies if the option 'use_smilies' is true and the global
     
    35383539
    35393540/**
    3540  * Convert to ASCII from email subjects.
     3541 * Converts to ASCII from email subjects.
    35413542 *
    35423543 * @since 1.2.0
    35433544 *
    3544  * @param string $string Subject line
    3545  * @return string Converted string to ASCII
     3545 * @param string $string Subject line.
     3546 * @return string Converted string to ASCII.
    35463547 */
    35473548function wp_iso_descrambler( $string ) {
     
    35563557
    35573558/**
    3558  * Helper function to convert hex encoded chars to ASCII
     3559 * Helper function to convert hex encoded chars to ASCII.
    35593560 *
    35603561 * @since 3.1.0
    35613562 * @access private
    35623563 *
    3563  * @param array $match The preg_replace_callback matches array
    3564  * @return string Converted chars
     3564 * @param array $match The preg_replace_callback matches array.
     3565 * @return string Converted chars.
    35653566 */
    35663567function _wp_iso_convert( $match ) {
     
    42934294
    42944295/**
    4295  * Perform a deep string replace operation to ensure the values in $search are no longer present
     4296 * Performs a deep string replace operation to ensure the values in $search are no longer present.
    42964297 *
    42974298 * Repeats the replacement operation until it no longer replaces anything so as to remove "nested" values
     
    44944495
    44954496/**
    4496  * Convert entities, while preserving already-encoded entities.
     4497 * Converts entities, while preserving already-encoded entities.
    44974498 *
    44984499 * @link https://www.php.net/htmlentities Borrowed from the PHP Manual user notes.
     
    45104511
    45114512/**
    4512  * Escape single quotes, htmlspecialchar " < > &, and fix line endings.
     4513 * Escapes single quotes, htmlspecialchar " < > &, and fixes line endings.
    45134514 *
    45144515 * Escapes text strings for echoing in JS. It is intended to be used for inline JS
     
    46704671
    46714672/**
    4672  * Escape an HTML tag name.
     4673 * Escapes an HTML tag name.
    46734674 *
    46744675 * @since 2.5.0
     
    46914692
    46924693/**
    4693  * Convert full URL paths to absolute paths.
     4694 * Converts full URL paths to absolute paths.
    46944695 *
    46954696 * Removes the http or https protocols and the domain. Keeps the path '/' at the
     
    50385039
    50395040/**
    5040  * Convert lone less than signs.
     5041 * Converts lone less than signs.
    50415042 *
    50425043 * KSES already converts lone greater than signs.
     
    50675068
    50685069/**
    5069  * Remove non-allowable HTML from parsed block attribute values when filtering
     5070 * Removes non-allowable HTML from parsed block attribute values when filtering
    50705071 * in the post context.
    50715072 *
     
    51695170
    51705171/**
    5171  * Localize list items before the rest of the content.
     5172 * Localizes list items before the rest of the content.
    51725173 *
    51735174 * The '%l' must be at the first characters can then contain the rest of the
     
    52685269
    52695270/**
    5270  * Add a Base url to relative links in passed content.
     5271 * Adds a base URL to relative links in passed content.
    52715272 *
    52725273 * By default it supports the 'src' and 'href' attributes. However this can be
     
    52905291
    52915292/**
    5292  * Callback to add a base url to relative links in passed content.
     5293 * Callback to add a base URL to relative links in passed content.
    52935294 *
    52945295 * @since 2.7.0
     
    53545355
    53555356/**
    5356  * Normalize EOL characters and strip duplicate whitespace.
     5357 * Normalizes EOL characters and strips duplicate whitespace.
    53575358 *
    53585359 * @since 2.7.0
     
    53695370
    53705371/**
    5371  * Properly strip all HTML tags including script and style
     5372 * Properly strips all HTML tags including script and style
    53725373 *
    53735374 * This differs from strip_tags() because it removes the contents of
     
    54535454
    54545455/**
    5455  * Internal helper function to sanitize a string from user input or from the db
     5456 * Internal helper function to sanitize a string from user input or from the database.
    54565457 *
    54575458 * @since 4.7.0
     
    55015502
    55025503/**
    5503  * i18n friendly version of basename()
     5504 * i18n-friendly version of basename().
    55045505 *
    55055506 * @since 3.1.0
     
    55445545
    55455546/**
    5546  * Sanitize a mime type
     5547 * Sanitizes a mime type
    55475548 *
    55485549 * @since 3.1.3
    55495550 *
    5550  * @param string $mime_type Mime type
    5551  * @return string Sanitized mime type
     5551 * @param string $mime_type Mime type.
     5552 * @return string Sanitized mime type.
    55525553 */
    55535554function sanitize_mime_type( $mime_type ) {
     
    55655566
    55665567/**
    5567  * Sanitize space or carriage return separated URLs that are used to send trackbacks.
     5568 * Sanitizes space or carriage return separated URLs that are used to send trackbacks.
    55685569 *
    55695570 * @since 3.4.0
     
    56355636
    56365637/**
    5637  * Extract and return the first URL from passed content.
     5638 * Extracts and returns the first URL from passed content.
    56385639 *
    56395640 * @since 3.6.0
     
    56885689
    56895690/**
    5690  * Print the important emoji-related styles.
     5691 * Prints the important emoji-related styles.
    56915692 *
    56925693 * @since 4.2.0
     
    57215722
    57225723/**
    5723  * Print the inline Emoji detection script if it is not already printed.
     5724 * Prints the inline Emoji detection script if it is not already printed.
    57245725 *
    57255726 * @since 4.2.0
     
    58065807
    58075808/**
    5808  * Convert emoji characters to their equivalent HTML entity.
     5809 * Converts emoji characters to their equivalent HTML entity.
    58095810 *
    58105811 * This allows us to store emoji in a DB using the utf8 character set.
     
    58295830
    58305831/**
    5831  * Convert emoji to a static img element.
     5832 * Converts emoji to a static img element.
    58325833 *
    58335834 * @since 4.2.0
     
    59245925
    59255926/**
    5926  * Convert emoji in emails into static images.
     5927 * Converts emoji in emails into static images.
    59275928 *
    59285929 * @since 4.2.0
     
    60186019
    60196020/**
    6020  * Shorten a URL, to be used as link text.
     6021 * Shortens a URL, to be used as link text.
    60216022 *
    60226023 * @since 1.2.0
Note: See TracChangeset for help on using the changeset viewer.