Make WordPress Core

Changeset 55844


Ignore:
Timestamp:
05/21/2023 10:39:52 AM (19 months ago)
Author:
SergeyBiryukov
Message:

Docs: Improve a few DocBlocks in wp-includes/formatting.php.

This addresses missing hyphens, typos and unnecessarily complex language.

Follow-up to [8540], [8743], [11615], [11907], [28670], [42056].

Props apermo.
Fixes #58316.

File:
1 edited

Legend:

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

    r55760 r55844  
    38323832 * Determines the difference between two timestamps.
    38333833 *
    3834  * The difference is returned in a human readable format such as "1 hour",
     3834 * The difference is returned in a human-readable format such as "1 hour",
    38353835 * "5 mins", "2 days".
    38363836 *
     
    38403840 * @param int $from Unix timestamp from which the difference begins.
    38413841 * @param int $to   Optional. Unix timestamp to end the time difference. Default becomes time() if not set.
    3842  * @return string Human readable time difference.
     3842 * @return string Human-readable time difference.
    38433843 */
    38443844function human_time_diff( $from, $to = 0 ) {
     
    39013901
    39023902    /**
    3903      * Filters the human readable difference between two timestamps.
     3903     * Filters the human-readable difference between two timestamps.
    39043904     *
    39053905     * @since 4.0.0
    39063906     *
    3907      * @param string $since The difference in human readable text.
     3907     * @param string $since The difference in human-readable text.
    39083908     * @param int    $diff  The difference in seconds.
    39093909     * @param int    $from  Unix timestamp from which the difference begins.
     
    39183918 * Returns a maximum of 55 words with an ellipsis appended if necessary.
    39193919 *
    3920  * The 55 word limit can be modified by plugins/themes using the {@see 'excerpt_length'} filter
     3920 * The 55-word limit can be modified by plugins/themes using the {@see 'excerpt_length'} filter
    39213921 * The ' […]' string can be modified by plugins/themes using the {@see 'excerpt_more'} filter
    39223922 *
     
    43554355 * Performs a deep string replace operation to ensure the values in $search are no longer present.
    43564356 *
    4357  * Repeats the replacement operation until it no longer replaces anything so as to remove "nested" values
     4357 * Repeats the replacement operation until it no longer replaces anything to remove "nested" values
    43584358 * e.g. $subject = '%0%0%0DDD', $search ='%0D', $result ='' rather than the '%0%0DD' that
    43594359 * str_replace would return
     
    43874387 * NOTE: Since 4.8.3, '%' characters will be replaced with a placeholder string,
    43884388 * this prevents certain SQLi attacks from taking place. This change in behavior
    4389  * may cause issues for code that expects the return value of esc_sql() to be useable
     4389 * may cause issues for code that expects the return value of esc_sql() to be usable
    43904390 * for other purposes.
    43914391 *
     
    51565156
    51575157/**
    5158  * WordPress implementation of PHP sprintf() with filters.
     5158 * WordPress' implementation of PHP sprintf() with filters.
    51595159 *
    51605160 * @since 2.5.0
     
    53345334 * Adds a base URL to relative links in passed content.
    53355335 *
    5336  * By default it supports the 'src' and 'href' attributes. However this can be
    5337  * changed via the 3rd param.
     5336 * By default, this function supports the 'src' and 'href' attributes.
     5337 * However, this can be modified via the `$attrs` parameter.
    53385338 *
    53395339 * @since 2.7.0
     
    53785378 * Adds a target attribute to all links in passed content.
    53795379 *
    5380  * This function by default only applies to `<a>` tags, however this can be
    5381  * modified by the `$tags` parameter.
     5380 * By default, this function only applies to `<a>` tags.
     5381 * However, this can be modified via the `$tags` parameter.
    53825382 *
    53835383 * *NOTE:* Any current target attribute will be stripped and replaced.
Note: See TracChangeset for help on using the changeset viewer.