Ticket #43159: 43159.3.diff
File 43159.3.diff, 4.4 KB (added by , 8 months ago) |
---|
-
wp-includes/admin-bar.php
1348 1348 global $show_admin_bar, $pagenow; 1349 1349 1350 1350 // For all these types of requests, we never want an admin bar. 1351 if ( defined( 'XMLRPC_REQUEST') || defined( 'DOING_AJAX' ) || defined( 'IFRAME_REQUEST' ) || wp_is_json_request() ) {1351 if ( wp_doing_xmlrpc() || defined( 'DOING_AJAX' ) || defined( 'IFRAME_REQUEST' ) || wp_is_json_request() ) { 1352 1352 return false; 1353 1353 } 1354 1354 -
wp-includes/cron.php
887 887 } 888 888 889 889 if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) { 890 if ( 'GET' !== $_SERVER['REQUEST_METHOD'] || defined( 'DOING_AJAX' ) || defined( 'XMLRPC_REQUEST') ) {890 if ( 'GET' !== $_SERVER['REQUEST_METHOD'] || defined( 'DOING_AJAX' ) || wp_doing_xmlrpc() ) { 891 891 return false; 892 892 } 893 893 -
wp-includes/functions.php
3761 3761 * @param callable $callback Callback function name. 3762 3762 */ 3763 3763 $callback = apply_filters( 'wp_die_jsonp_handler', '_jsonp_wp_die_handler' ); 3764 } elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST) {3764 } elseif ( wp_doing_xmlrpc() ) { 3765 3765 /** 3766 3766 * Filters the callback for killing WordPress execution for XML-RPC requests. 3767 3767 * -
wp-includes/load.php
610 610 * The 'REST_REQUEST' check here is optimistic as the constant is most 611 611 * likely not set at this point even if it is in fact a REST request. 612 612 */ 613 if ( defined( 'XMLRPC_REQUEST') || defined( 'REST_REQUEST' ) || defined( 'MS_FILES_REQUEST' )613 if ( wp_doing_xmlrpc() || defined( 'REST_REQUEST' ) || defined( 'MS_FILES_REQUEST' ) 614 614 || ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) 615 615 || wp_doing_ajax() || wp_is_json_request() 616 616 ) { … … 1747 1747 return apply_filters( 'wp_doing_cron', defined( 'DOING_CRON' ) && DOING_CRON ); 1748 1748 } 1749 1749 1750 /** 1751 * Determines whether the current request is a WordPress XML-RPC request. 1752 * 1753 * @since 6.7.0 1754 * 1755 * @return bool True if it's a WordPress XML-RPC request, false otherwise. 1756 */ 1757 function wp_doing_xmlrpc() { 1758 /** 1759 * Filters whether the current request is a WordPress XML-RPC request. 1760 * 1761 * @since 6.7.0 1762 * 1763 * @param bool $wp_doing_cron Whether the current request is a WordPress XML-RPC request. 1764 */ 1765 return apply_filters( 'wp_doing_xmlrpc', defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ); 1766 } 1767 1750 1768 /** 1751 1769 * Checks whether the given variable is a WordPress Error. 1752 1770 * -
wp-includes/post.php
7675 7675 /** 7676 7676 * Hook to schedule pings and enclosures when a post is published. 7677 7677 * 7678 * Uses XMLRPC_REQUEST andWP_IMPORTING constants.7678 * Uses WP_IMPORTING constants. 7679 7679 * 7680 7680 * @since 2.3.0 7681 7681 * @access private … … 7683 7683 * @param int $post_id The ID of the post being published. 7684 7684 */ 7685 7685 function _publish_post_hook( $post_id ) { 7686 if ( defined( 'XMLRPC_REQUEST') ) {7686 if ( wp_doing_xmlrpc() ) { 7687 7687 /** 7688 7688 * Fires when _publish_post_hook() is called during an XML-RPC request. 7689 7689 * -
wp-includes/user.php
352 352 } 353 353 354 354 // The 'REST_REQUEST' check here may happen too early for the constant to be available. 355 $is_api_request = ( ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST) || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) );355 $is_api_request = ( wp_doing_xmlrpc() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ); 356 356 357 357 /** 358 358 * Filters whether this is an API request that Application Passwords can be used on. … … 3654 3654 return $current_user; 3655 3655 } 3656 3656 3657 if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST) {3657 if ( wp_doing_xmlrpc() ) { 3658 3658 wp_set_current_user( 0 ); 3659 3659 return $current_user; 3660 3660 }