diff options
Diffstat (limited to 'plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/publicize-services.php')
-rw-r--r-- | plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/publicize-services.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/publicize-services.php b/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/publicize-services.php index fb418263..4641b218 100644 --- a/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/publicize-services.php +++ b/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/publicize-services.php @@ -144,6 +144,14 @@ class WPCOM_REST_API_V2_Endpoint_List_Publicize_Services extends WP_REST_Control public function get_items_permission_check() { global $publicize; + if ( ! $publicize ) { + return new WP_Error( + 'publicize_not_available', + __( 'Sorry, Publicize is not available on your site right now.', 'jetpack' ), + array( 'status' => rest_authorization_required_code() ) + ); + } + if ( $publicize->current_user_can_access_publicize_data() ) { return true; } |