diff --git a/projects/plugins/jetpack/changelog/update-sharing-rm-api b/projects/plugins/jetpack/changelog/update-sharing-rm-api new file mode 100644 index 0000000000000..825201729bf54 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-sharing-rm-api @@ -0,0 +1,4 @@ +Significance: patch +Type: bugfix + +Sharing: do not include the sharing buttons in REST API responses. diff --git a/projects/plugins/jetpack/modules/sharedaddy/sharing-service.php b/projects/plugins/jetpack/modules/sharedaddy/sharing-service.php index de677edb13b98..8b749fcc2ac72 100644 --- a/projects/plugins/jetpack/modules/sharedaddy/sharing-service.php +++ b/projects/plugins/jetpack/modules/sharedaddy/sharing-service.php @@ -959,8 +959,7 @@ function sharing_display( $text = '', $echo = false ) { } // Prevent from rendering sharing buttons in block which is fetched from REST endpoint by editor - if ( defined( 'REST_REQUEST' ) && REST_REQUEST && - isset( $_GET['context'] ) && 'edit' === $_GET['context'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { return $text; }