Make WordPress Core


Ignore:
Timestamp:
06/26/2020 06:47:28 PM (19 months 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/post.php

    r48104 r48185  
    36863686     * 2. The title, editor, and excerpt fields are all empty
    36873687     *
    3688      * Passing a truthy value to the filter will effectively short-circuit
    3689      * the new post being inserted, returning 0. If $wp_error is true, a WP_Error
     3688     * Returning a truthy value from the filter will effectively short-circuit
     3689     * the new post being inserted and return 0. If $wp_error is true, a WP_Error
    36903690     * will be returned instead.
    36913691     *
Note: See TracChangeset for help on using the changeset viewer.