Make WordPress Core


Ignore:
Timestamp:
02/18/2013 07:22:58 PM (12 years ago)
Author:
helen
Message:

Output fallbacks / theme compat for post format metadata.

  • Currently handles link, quote, image, gallery, audio, and video formats.
  • add_theme_support() for a given post format is now an indicator that the theme handles format-specific metadata.
  • If no support for a given format is defined, fallback output will be generated and hooked onto the_content if a post has metadata for that format.
  • Fallbacks attempt to be smart about not duplicating data already appearing in the post content itself. Gallery is particularly liberal, looking for any instance of the gallery shortcode in the content, not just an exact match to the gallery shortcode defined in the format-specific meta.
  • Compat output defaults to being wrapped in a div with a class of post-format-content.

Theme authors: please test and evaluate, keeping in mind that the goal is to support user expectations of not losing format-specific data they've entered in the admin when viewing the front-end of their site.

props wonderboymusic, beaulebens, helen. see #23347.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/default-filters.php

    r23416 r23450  
    133133add_filter( 'the_title', 'trim'          );
    134134
    135 add_filter( 'the_content', 'wptexturize'        );
    136 add_filter( 'the_content', 'convert_smilies'    );
    137 add_filter( 'the_content', 'convert_chars'      );
    138 add_filter( 'the_content', 'wpautop'            );
    139 add_filter( 'the_content', 'shortcode_unautop'  );
    140 add_filter( 'the_content', 'prepend_attachment' );
     135add_filter( 'the_content', 'post_formats_compat', 7 );
     136add_filter( 'the_content', 'wptexturize'            );
     137add_filter( 'the_content', 'convert_smilies'        );
     138add_filter( 'the_content', 'convert_chars'          );
     139add_filter( 'the_content', 'wpautop'                );
     140add_filter( 'the_content', 'shortcode_unautop'      );
     141add_filter( 'the_content', 'prepend_attachment'     );
    141142
    142143add_filter( 'the_excerpt',     'wptexturize'      );
Note: See TracChangeset for help on using the changeset viewer.