Skip to content

Commit

Permalink
Social Notes: ensure the filter does not impact other CPTs (#39763)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraftbj authored Oct 14, 2024
1 parent 3a0af94 commit 65ae8d8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: Resolves a bug in an unreleased feature


14 changes: 8 additions & 6 deletions projects/plugins/social/src/class-note.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,16 @@ public function register_cpt() {
* @return array The allowed blocks.
*/
public function restrict_blocks_for_social_note( $allowed_blocks, $post ) {
if ( 'jetpack-social-note' === $post->post_type ) {
// Only allow the paragraph block and the featured image block.
$allowed_blocks = array(
'core/paragraph',
'core/post-featured-image',
);
if ( 'jetpack-social-note' !== $post->post_type ) { // Let 'em pass.
return $allowed_blocks;
}

// Only allow the paragraph block and the featured image block.
$allowed_blocks = array(
'core/paragraph',
'core/post-featured-image',
);

/**
* Filters the blocks available to the Social Notes CPT.
*
Expand Down

0 comments on commit 65ae8d8

Please sign in to comment.