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/rest-api/endpoints/class-wp-rest-comments-controller.php

    r48154 r48185  
    683683         *
    684684         * Allows modification of the comment right before it is inserted via wp_insert_comment().
    685          * Returning a WP_Error value from the filter will shortcircuit insertion and allow
     685         * Returning a WP_Error value from the filter will short-circuit insertion and allow
    686686         * skipping further processing.
    687687         *
    688688         * @since 4.7.0
    689          * @since 4.8.0 `$prepared_comment` can now be a WP_Error to shortcircuit insertion.
     689         * @since 4.8.0 `$prepared_comment` can now be a WP_Error to short-circuit insertion.
    690690         *
    691691         * @param array|WP_Error  $prepared_comment The prepared comment data for wp_insert_comment().
Note: See TracChangeset for help on using the changeset viewer.