Make WordPress Core

Opened 11 years ago

Closed 8 years ago

#28332 closed enhancement (invalid)

remove_filter( 'wpautop' ) not working completely

Reported by: robbash's profile RobBash Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9.1
Component: Editor Keywords: needs-testing
Focuses: administration Cc:

Description

In my functions.php I call remove_filter( 'the_content', 'wpautop' ).

After saving the output on the blog is correct so it must be stored correctly in the database, but in the editor (tinymce) it is not. I also installed the plugin TinyMCE Advanced the prevent cleanup by the editor.

I investigated the issue a bit and found out that the wpautop method is still called before the content is displayed in the editor and the double line breaks are replaced by <p>-tags, which shouldn't be after the remove_filter. I also debugged in that method to make sure the filter is removed.

Change History (2)

#1 @Bishoy.A
10 years ago

  • Keywords needs-testing added
  • Type changed from defect (bug) to enhancement

I think the 'wpautop' filter is not added to the Admin Editor, so remove_filter( 'the_content', 'wpautop' ) will have no effect there anyway.

Last edited 10 years ago by Bishoy.A (previous) (diff)

#2 @swissspidy
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

remove_filter( 'the_content', 'wpautop' ) is for the front-end online.

The editor has its own autop implementation on the JavaScript side to make editing as easy as possible.

See https://core.trac.wordpress.org/browser/tags/4.7.2/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js#L13 how the editor plugin checks for its availability.

Note: See TracTickets for help on using tickets.