Automatic Theme Fallbacks for Post Formats in WordPress 3.6

WordPress 3.6 adding post format content to main content automatically

Today I noticed that WordPress (3.6-alpha-23883) has started automatically adding content to my posts that use post format other than the standard “post” and have some of the new meta fields filled out. Then I found this ticket #23347 which along with the attached patches explained everything — posts of the following post format: link, image, quote, video and audio will have post_formats_compat applied to the_content filter in wp-includes/default-filters.php, which means that all themes that don’t explicitly define

add_theme_support( 'structured-post-formats', array( 'link', 'image', 'etc...' ) )

will have that meta information prepended or appended automatically to post content.

Solution

Simply remove post_formats_compat from the_content filter, like so:

remove_filter( 'the_content', 'post_formats_compat', 7 );

or mark your theme as being aware of that new post format meta:

add_theme_support( 'structured-post-formats', array( 'link', 'image', 'quote', 'video', 'audio' ) );

Never lose a single business lead or enquiry again! Get my latest plugin Storage for Contact Form 7 now!

Buy now for only $18 →

Leave a Reply