WordPress.org

Make WordPress Core

Ticket #43159: 43159.2.diff

File 43159.2.diff, 4.1 KB (added by NathanAtmoz, 3 years ago)
  • src/wp-includes/admin-bar.php

    diff --git a/src/wp-includes/admin-bar.php b/src/wp-includes/admin-bar.php
    index 19f51a8..24115c3 100644
    a b function is_admin_bar_showing() { 
    11301130        global $show_admin_bar, $pagenow;
    11311131
    11321132        // For all these types of requests, we never want an admin bar.
    1133         if ( defined( 'XMLRPC_REQUEST' ) || defined( 'DOING_AJAX' ) || defined( 'IFRAME_REQUEST' ) ) {
     1133        if ( wp_doing_xmlrpc() || defined( 'DOING_AJAX' ) || defined( 'IFRAME_REQUEST' ) ) {
    11341134                return false;
    11351135        }
    11361136
  • src/wp-includes/cron.php

    diff --git a/src/wp-includes/cron.php b/src/wp-includes/cron.php
    index fbf5a62..46e93a7 100644
    a b function spawn_cron( $gmt_time = 0 ) { 
    351351        }
    352352
    353353        if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) {
    354                 if ( 'GET' !== $_SERVER['REQUEST_METHOD'] || defined( 'DOING_AJAX' ) || defined( 'XMLRPC_REQUEST' ) ) {
     354                if ( 'GET' !== $_SERVER['REQUEST_METHOD'] || defined( 'DOING_AJAX' ) || wp_doing_xmlrpc() ) {
    355355                        return;
    356356                }
    357357
  • src/wp-includes/functions.php

    diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
    index ec5a3d2..7e4b37a 100644
    a b function wp_die( $message = '', $title = '', $args = array() ) { 
    27842784                 * @param callable $function Callback function name.
    27852785                 */
    27862786                $function = apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler' );
    2787         } elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {
     2787        } elseif ( wp_doing_xmlrpc() ) {
    27882788                /**
    27892789                 * Filters the callback for killing WordPress execution for XML-RPC requests.
    27902790                 *
  • src/wp-includes/load.php

    diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php
    index a29eed1..47f4491 100644
    a b function wp_debug_mode() { 
    349349                error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
    350350        }
    351351
    352         if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) || wp_doing_ajax() ) {
     352        if ( wp_doing_xmlrpc() || defined( 'REST_REQUEST' ) || ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) || wp_doing_ajax() ) {
    353353                @ini_set( 'display_errors', 0 );
    354354        }
    355355}
    function wp_doing_cron() { 
    11551155}
    11561156
    11571157/**
     1158 * Determines whether the current request is a WordPress XML-RPC request.
     1159 *
     1160 * @since 5.0.0
     1161 *
     1162 * @return bool True if it's a WordPress XML-RPC request, false otherwise.
     1163 */
     1164function wp_doing_xmlrpc() {
     1165        /**
     1166         * Filters whether the current request is a WordPress XML-RPC request.
     1167         *
     1168         * @since 5.0.0
     1169         *
     1170         * @param bool $wp_doing_cron Whether the current request is a WordPress XML-RPC request.
     1171         */
     1172        return apply_filters( 'wp_doing_xmlrpc', defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST );
     1173}
     1174
     1175/**
    11581176 * Check whether variable is a WordPress Error.
    11591177 *
    11601178 * Returns true if $thing is an object of the WP_Error class.
  • src/wp-includes/post.php

    diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
    index b35930a..322ed24 100644
    a b function _future_post_hook( $deprecated, $post ) { 
    62586258/**
    62596259 * Hook to schedule pings and enclosures when a post is published.
    62606260 *
    6261  * Uses XMLRPC_REQUEST and WP_IMPORTING constants.
     6261 * Uses WP_IMPORTING constant.
    62626262 *
    62636263 * @since 2.3.0
    62646264 * @access private
    function _future_post_hook( $deprecated, $post ) { 
    62666266 * @param int $post_id The ID in the database table of the post being published.
    62676267 */
    62686268function _publish_post_hook( $post_id ) {
    6269         if ( defined( 'XMLRPC_REQUEST' ) ) {
     6269        if ( wp_doing_xmlrpc() ) {
    62706270                /**
    62716271                 * Fires when _publish_post_hook() is called during an XML-RPC request.
    62726272                 *
  • src/wp-includes/user.php

    diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
    index 9a685b9..03302cc 100644
    a b function _wp_get_current_user() { 
    26462646                return $current_user;
    26472647        }
    26482648
    2649         if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {
     2649        if ( wp_doing_xmlrpc() ) {
    26502650                wp_set_current_user( 0 );
    26512651                return $current_user;
    26522652        }