WordPress.org

Make WordPress Core

Ticket #36576: 36576.diff

File 36576.diff, 2.4 KB (added by garrett-eclipse, 10 months ago)

Updated patch to introduce a perform_pings action inside of the do_all_pings function.

  • src/wp-includes/comment.php

     
    28002800 * Perform all pingbacks, enclosures, trackbacks, and send to pingback services.
    28012801 *
    28022802 * @since 2.1.0
     2803 * @since 5.6.0 Introduced `perform_pings` action hook for individual services.
    28032804 *
    2804  * @global wpdb $wpdb WordPress database abstraction object.
    28052805 */
    28062806function do_all_pings() {
    2807         global $wpdb;
     2807        /**
     2808         * Fires immediately after the `do_pings` event to hook services individually.
     2809         *
     2810         * @since 5.6.0
     2811         */
     2812        do_action( 'perform_pings', $id );
     2813}
    28082814
    2809         // Do pingbacks.
     2815
     2816/**
     2817 * Perform all pingbacks.
     2818 *
     2819 * @since 5.6.0
     2820 *
     2821 */
     2822function perform_pingbacks() {
    28102823        $pings = get_posts(
    28112824                array(
    28122825                        'post_type'        => get_post_types(),
     
    28212834                delete_post_meta( $ping, '_pingme' );
    28222835                pingback( null, $ping );
    28232836        }
     2837}
    28242838
    2825         // Do enclosures.
     2839
     2840/**
     2841 * Perform all enclosures.
     2842 *
     2843 * @since 5.6.0
     2844 *
     2845 */
     2846function perform_enclosures() {
    28262847        $enclosures = get_posts(
    28272848                array(
    28282849                        'post_type'        => get_post_types(),
     
    28372858                delete_post_meta( $enclosure, '_encloseme' );
    28382859                do_enclose( null, $enclosure );
    28392860        }
     2861}
    28402862
    2841         // Do trackbacks.
     2863
     2864/**
     2865 * Perform all trackbacks.
     2866 *
     2867 * @since 5.6.0
     2868 *
     2869 */
     2870function perform_trackbacks() {
    28422871        $trackbacks = get_posts(
    28432872                array(
    28442873                        'post_type'        => get_post_types(),
     
    28532882                delete_post_meta( $trackback, '_trackbackme' );
    28542883                do_trackbacks( $trackback );
    28552884        }
    2856 
    2857         // Do Update Services/Generic Pings.
    2858         generic_ping();
    28592885}
    28602886
    28612887/**
  • src/wp-includes/default-filters.php

     
    342342add_action( 'do_feed_rss2', 'do_feed_rss2', 10, 1 );
    343343add_action( 'do_feed_atom', 'do_feed_atom', 10, 1 );
    344344add_action( 'do_pings', 'do_all_pings', 10, 0 );
     345add_action( 'perform_pings', 'perform_pingbacks', 10, 0 );
     346add_action( 'perform_pings', 'perform_enclosures', 10, 0 );
     347add_action( 'perform_pings', 'perform_tracksbacks', 10, 0 );
     348add_action( 'perform_pings', 'generic_ping', 10, 0 );
    345349add_action( 'do_robots', 'do_robots' );
    346350add_action( 'do_favicon', 'do_favicon' );
    347351add_action( 'set_comment_cookies', 'wp_set_comment_cookies', 10, 3 );