Make WordPress Core


Ignore:
Timestamp:
06/26/2020 06:47:28 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Standardize on "Returning a value from the filter" vs. "Passing a value to the filter".

The filter is the callback function added with add_filter(), therefore the hook passes a value to the filter, and the filter returns a value to change its behaviour.

The documentation is referring to the latter.

Props johnbillion.
See #49572, #16557.

File:
1 edited

Legend:

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

    r48170 r48185  
    542542     * Filters whether to preempt calculating the image resize dimensions.
    543543     *
    544      * Passing a non-null value to the filter will effectively short-circuit
     544     * Returning a non-null value from the filter will effectively short-circuit
    545545     * image_resize_dimensions(), returning that value instead.
    546546     *
     
    16261626 *
    16271627 * @param string $content The HTML content to be filtered.
    1628  * @param string $context Optional. Additional context to pass to the filters. Defaults to `current_filter()` when not set.
     1628 * @param string $context Optional. Additional context to pass to the filters.
     1629 *                        Defaults to `current_filter()` when not set.
    16291630 * @return string Converted content with images modified.
    16301631 */
     
    23702371     * Filters the playlist output.
    23712372     *
    2372      * Passing a non-empty value to the filter will short-circuit generation
     2373     * Returning a non-empty value from the filter will short-circuit generation
    23732374     * of the default playlist output, returning the passed value instead.
    23742375     *
Note: See TracChangeset for help on using the changeset viewer.