WordPress.org

Make WordPress Core

Ticket #43159: 43159.diff

File 43159.diff, 2.3 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..9785316 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( 'IFRAME_REQUEST' ) ) {
    11341134                return false;
    11351135        }
    11361136
  • 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..4ba8545 100644
    a b 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/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        }