[wp-trac] [WordPress Trac] #40958: force_balance_tags breaks Ninjaforms and probably other plugins that output html within js.

WordPress Trac noreply at wordpress.org
Fri Aug 30 13:37:34 UTC 2024


#40958: force_balance_tags breaks Ninjaforms and probably other plugins that output
html within js.
--------------------------+---------------------------------
 Reporter:  programmin    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Shortcodes    |     Version:  4.7.4
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  ui, administration
--------------------------+---------------------------------

Comment (by vizvizka):

 remove_filter( 'the_content', 'force_balance_tags' ); // Disable
 force_balance_tags
 $content = apply_filters( 'the_content', $content_with_shortcodes ); //
 Process content with shortcodes
 add_filter( 'the_content', 'force_balance_tags' ); // Re-enable
 force_balance_tags


 function my_ninja_form_shortcode_handler( $atts ) {
     return ninja_forms_display_form( array( 'id' => 14 ) ); // Replace 14
 with your form ID
 }
 add_shortcode( 'my_ninja_form', 'my_ninja_form_shortcode_handler' );

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/40958#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list