Skip to content

Commit 9224b8c

Browse files
Like block: Remove block rendering from contexts other than front-end (#35226)
* Add changelog * Remove block rendering in contexts different from front-end * Add comment
1 parent 519f259 commit 9224b8c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: other
3+
4+
Like block: Remove block rendering in contexts different from front-end

projects/plugins/jetpack/extensions/blocks/like/like.php

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ function register_block() {
4242
* @return string
4343
*/
4444
function render_block( $attr, $content, $block ) {
45+
// Do not render the Like block in other context than front-end (i.e. feed, emails, API, etc.).
46+
if ( ! jetpack_is_frontend() ) {
47+
return;
48+
}
49+
4550
/*
4651
* Enqueue necessary scripts and styles.
4752
*/

0 commit comments

Comments
 (0)