Skip to content

Commit

Permalink
Stop o2-data script being appended to notice content
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwoodnz committed Oct 22, 2024
1 parent 8037511 commit 141e450
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mu-plugins/blocks/notice/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ function render_callout_as_notice( $attr, $content, $tag ) {
$content = wp_kses_post( $content );
// Temporarily disable o2 processing while formatting content.
add_filter( 'o2_process_the_content', '__return_false', 1 );
remove_filter( 'the_content', array( 'o2', 'add_json_data' ), 999999 );
$content = apply_filters( 'the_content', $content );
remove_filter( 'o2_process_the_content', '__return_false', 1 );
add_filter( 'the_content', array( 'o2', 'add_json_data' ), 999999 );

// Create a unique placeholder for the content.
// Directly processing `$content` with `do_blocks` can lead to buggy layouts on make.wp.org.
Expand Down

0 comments on commit 141e450

Please sign in to comment.