Make WordPress Core

Changeset 49211


Ignore:
Timestamp:
10/19/2020 09:14:06 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Pings/Trackbacks: Split do_all_pings() into several functions:

  • do_all_pingbacks()
  • do_all_enclosures()
  • do_all_trackbacks()

This allows for the specific removal/replacement of one of more services.

Props dshanske, garrett-eclipse, Mista-Flo, azaozz, hellofromTonya.
Fixes #36576.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r49193 r49211  
    28012801 *
    28022802 * @since 2.1.0
    2803  *
    2804  * @global wpdb $wpdb WordPress database abstraction object.
     2803 * @since 5.6.0 Introduced `do_all_pings` action hook for individual services.
    28052804 */
    28062805function do_all_pings() {
    2807     global $wpdb;
    2808 
    2809     // Do pingbacks.
     2806    /**
     2807     * Fires immediately after the `do_pings` event to hook services individually.
     2808     *
     2809     * @since 5.6.0
     2810     */
     2811    do_action( 'do_all_pings' );
     2812}
     2813
     2814/**
     2815 * Perform all pingbacks.
     2816 *
     2817 * @since 5.6.0
     2818 */
     2819function do_all_pingbacks() {
    28102820    $pings = get_posts(
    28112821        array(
     
    28222832        pingback( null, $ping );
    28232833    }
    2824 
    2825     // Do enclosures.
     2834}
     2835
     2836/**
     2837 * Perform all enclosures.
     2838 *
     2839 * @since 5.6.0
     2840 */
     2841function do_all_enclosures() {
    28262842    $enclosures = get_posts(
    28272843        array(
     
    28382854        do_enclose( null, $enclosure );
    28392855    }
    2840 
    2841     // Do trackbacks.
     2856}
     2857
     2858/**
     2859 * Perform all trackbacks.
     2860 *
     2861 * @since 5.6.0
     2862 */
     2863function do_all_trackbacks() {
    28422864    $trackbacks = get_posts(
    28432865        array(
     
    28542876        do_trackbacks( $trackback );
    28552877    }
    2856 
    2857     // Do Update Services/Generic Pings.
    2858     generic_ping();
    28592878}
    28602879
  • trunk/src/wp-includes/default-filters.php

    r49109 r49211  
    343343add_action( 'do_feed_atom', 'do_feed_atom', 10, 1 );
    344344add_action( 'do_pings', 'do_all_pings', 10, 0 );
     345add_action( 'do_all_pings', 'do_all_pingbacks', 10, 0 );
     346add_action( 'do_all_pings', 'do_all_enclosures', 10, 0 );
     347add_action( 'do_all_pings', 'do_all_trackbacks', 10, 0 );
     348add_action( 'do_all_pings', 'generic_ping', 10, 0 );
    345349add_action( 'do_robots', 'do_robots' );
    346350add_action( 'do_favicon', 'do_favicon' );
Note: See TracChangeset for help on using the changeset viewer.