[wp-trac] [WordPress Trac] #31947: Allow developers to enable $br in wpautop() using a filter

WordPress Trac noreply at wordpress.org
Thu Sep 10 10:14:49 UTC 2015


#31947: Allow developers to enable $br in wpautop() using a filter
-------------------------+------------------------------
 Reporter:  KTOmega      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Formatting   |     Version:  4.2
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by bobbingwide):

 Hi, I support the requirement to disable br processing. My solution was to
 write a replacement filter function.

 {{{
 if ( !function_exists( "wpautop_nobr" ) ) {
 function wpautop_nobr( $pee ) {
   return( wpautop( $pee, false ) );
 }
 }
 }}}

 Then remove the wpautop filter function and replace it with one with the
 same or different priority.

 {{{
   remove_filter( 'the_content', 'wpautop' );
   add_filter( 'the_content', 'wpautop_nobr', 99 );
 }}}

 Would this satisfy your needs?

 With regards to your patch.
 If would be more efficient to defer the filter processing until after
 testing $pee.

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


More information about the wp-trac mailing list