Skip to content

Commit 8b69d1c

Browse files
authored
REST API: Check if get_blog_details() is callable (#718)
* REST API: Check if get_blog_details() is callable
1 parent 433e9cc commit 8b69d1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mu-plugins/rest-api/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ function initialize_rest_endpoints() {
2121
$users_controller->register_routes();
2222

2323
// The Site Quality controller is only needed on the main site. Note: domain check is due to this plugin running on multiple networks.
24-
if ( 1 === get_current_blog_id() && 'wordpress.org' === get_blog_details()->domain ) {
24+
if ( 1 === get_current_blog_id() && function_exists( 'get_blog_details' ) && 'wordpress.org' === get_blog_details()->domain ) {
2525
require_once __DIR__ . '/endpoints/class-wporg-site-quality-controller.php';
2626
}
27-
27+
2828
if ( defined( 'WPORG_THEME_DIRECTORY_BLOGID' ) && WPORG_THEME_DIRECTORY_BLOGID === get_current_blog_id() ) {
2929
require_once __DIR__ . '/endpoints/class-wporg-base-locale-banner-controller.php';
3030
require_once __DIR__ . '/endpoints/class-wporg-themes-locale-banner-controller.php';

0 commit comments

Comments
 (0)