Admin Bar: Set the Admin Bar to not be showing on REST API requests.

Props ayeshrajans.
Fixes #45727.



git-svn-id: https://develop.svn.wordpress.org/trunk@44608 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2019-01-16 02:53:15 +00:00
parent 99bcf2719b
commit c2862a404e
1 changed files with 1 additions and 1 deletions

View File

@ -1136,7 +1136,7 @@ function is_admin_bar_showing() {
global $show_admin_bar, $pagenow; global $show_admin_bar, $pagenow;
// For all these types of requests, we never want an admin bar. // For all these types of requests, we never want an admin bar.
if ( defined( 'XMLRPC_REQUEST' ) || defined( 'DOING_AJAX' ) || defined( 'IFRAME_REQUEST' ) ) { if ( defined( 'XMLRPC_REQUEST' ) || defined( 'DOING_AJAX' ) || defined( 'IFRAME_REQUEST' ) || wp_is_json_request() ) {
return false; return false;
} }