Make WordPress Core


Ignore:
Timestamp:
08/12/2026 11:06:15 AM (3 months ago)
Author:
SergeyBiryukov
Message:

Pings/Trackbacks: Adjust auto-approving pingbacks and trackbacks from the same site.

Includes:

  • Updating version annotations to 7.1.0.
  • Clarifying "this site" means "the same site" in various docs.
  • Prefixing the new filter with wp_.
  • Extending the tests:
    • Adds a test to ensure MS sub-site posts are not auto approved.
    • Adds a test to ensure that post ID sent to filter is zero for external sites.
    • Adds docs for each test.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/12928.

Follow-up to r63036.

Props peterwilsoncc, jeremyfelt, youknowriad, wildworks, sabernhardt, SergeyBiryukov.
See #65016.

File:
1 edited

Legend:

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

    r63036 r63207  
    2121 * approved.
    2222 *
    23  * Pingbacks originating from this site are automatically approved, as the link
    24  * they report was created by someone who can already publish here.
     23 * Pingbacks originating from the same site are automatically approved, as the
     24 * link they report was created by someone who can already publish here.
    2525 *
    2626 * If all checks pass, the function will return true.
    2727 *
    2828 * @since 1.2.0
    29  * @since 7.2.0 Pingbacks from this site are no longer held for moderation.
     29 * @since 7.1.0 Pingbacks from the same site are no longer held for moderation.
    3030 *
    3131 * @global wpdb $wpdb WordPress database abstraction object.
    … …  
    184184                         * Filters whether a pingback is approved without being held for moderation.
    185185                         *
    186                          * Defaults to true for pingbacks originating from a published post on this
     186                         * Defaults to true for pingbacks originating from a published post on the same
    187187                         * site, and false for every other pingback. Trackbacks are never considered,
    188188                         * as they cannot be verified.
    189189                         *
    190                          * @since 7.2.0
     190                         * @since 7.1.0
    191191                         *
    192                          * @param bool   $approve_pingback Whether to approve the pingback.
     192                         * @param bool   $approve_pingback Whether to auto-approve the pingback.
    193193                         * @param int    $source_id        ID of the post on this site the pingback
    194194                         *                                 originated from, or 0 if it came from elsewhere.
    195195                         * @param string $url              The URL the pingback was sent from.
    196196                         */
    197                         return (bool) apply_filters( 'auto_approve_pingback', $approve_pingback, $source_id, $url );
     197                        return (bool) apply_filters( 'wp_auto_approve_ping', $approve_pingback, $source_id, $url );
    198198                } else {
    199199                        return false;
Note: See TracChangeset for help on using the changeset viewer.