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() { |
1130 | 1130 | global $show_admin_bar, $pagenow; |
1131 | 1131 | |
1132 | 1132 | // 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' ) ) { |
1134 | 1134 | return false; |
1135 | 1135 | } |
1136 | 1136 | |
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 ) { |
351 | 351 | } |
352 | 352 | |
353 | 353 | 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() ) { |
355 | 355 | return; |
356 | 356 | } |
357 | 357 | |
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() ) { |
2784 | 2784 | * @param callable $function Callback function name. |
2785 | 2785 | */ |
2786 | 2786 | $function = apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler' ); |
2787 | | } elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) { |
| 2787 | } elseif ( wp_doing_xmlrpc() ) { |
2788 | 2788 | /** |
2789 | 2789 | * Filters the callback for killing WordPress execution for XML-RPC requests. |
2790 | 2790 | * |
diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php
index a29eed1..47f4491 100644
a
|
b
|
function wp_debug_mode() { |
349 | 349 | 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 ); |
350 | 350 | } |
351 | 351 | |
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() ) { |
353 | 353 | @ini_set( 'display_errors', 0 ); |
354 | 354 | } |
355 | 355 | } |
… |
… |
function wp_doing_cron() { |
1155 | 1155 | } |
1156 | 1156 | |
1157 | 1157 | /** |
| 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 | */ |
| 1164 | function 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 | /** |
1158 | 1176 | * Check whether variable is a WordPress Error. |
1159 | 1177 | * |
1160 | 1178 | * Returns true if $thing is an object of the WP_Error class. |
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 ) { |
6258 | 6258 | /** |
6259 | 6259 | * Hook to schedule pings and enclosures when a post is published. |
6260 | 6260 | * |
6261 | | * Uses XMLRPC_REQUEST and WP_IMPORTING constants. |
| 6261 | * Uses WP_IMPORTING constant. |
6262 | 6262 | * |
6263 | 6263 | * @since 2.3.0 |
6264 | 6264 | * @access private |
… |
… |
function _future_post_hook( $deprecated, $post ) { |
6266 | 6266 | * @param int $post_id The ID in the database table of the post being published. |
6267 | 6267 | */ |
6268 | 6268 | function _publish_post_hook( $post_id ) { |
6269 | | if ( defined( 'XMLRPC_REQUEST' ) ) { |
| 6269 | if ( wp_doing_xmlrpc() ) { |
6270 | 6270 | /** |
6271 | 6271 | * Fires when _publish_post_hook() is called during an XML-RPC request. |
6272 | 6272 | * |
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() { |
2646 | 2646 | return $current_user; |
2647 | 2647 | } |
2648 | 2648 | |
2649 | | if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) { |
| 2649 | if ( wp_doing_xmlrpc() ) { |
2650 | 2650 | wp_set_current_user( 0 ); |
2651 | 2651 | return $current_user; |
2652 | 2652 | } |