Make WordPress Core

Changeset 23467


Ignore:
Timestamp:
02/21/2013 10:48:09 PM (12 years ago)
Author:
helen
Message:

Implement theme support for structured-post-formats, which will supercede theme support for post-formats. Usage is the same as declaring support for post-formats: add_theme_support( 'structured-post-formats', array( 'quote', 'video' ) ). Adding structured-post-formats support also adds post-formats support for the given format(s) underneath.

Declaring support for a given format indicates that the theme handles format-specific metadata; admin UI will not change based on theme-declared support of either variety as it did previously. If no structured-post-formats support is explicitly declared for a format, a post in that format will have fallback output utilizing that metadata applied. In this way, a theme can style core-provided output for a full post format experience without having to handle metadata in any way.

props nacin. see #23347.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r23367 r23467  
    12581258
    12591259    switch ( $feature ) {
     1260        case 'structured-post-formats' :
     1261            if ( is_array( $args[0] ) )
     1262                $args[0] = array_intersect( $args[0], array_keys( get_post_format_slugs() ) );
     1263            // structured-post-formats support automatically adds support for post-formats.
     1264            $_wp_theme_features['post-formats'] = $args;
    12601265        case 'post-formats' :
    1261             if ( is_array( $args[0] ) )
     1266            // An existing structured-post-formats support declaration overrides post-formats.
     1267            if ( current_theme_supports( 'structured-post-formats' ) )
     1268                $args = get_theme_support( 'structured-post-formats' );
     1269            elseif ( is_array( $args[0] ) )
    12621270                $args[0] = array_intersect( $args[0], array_keys( get_post_format_slugs() ) );
    12631271            break;
     
    15461554            break;
    15471555
     1556        case 'structured-post-formats':
    15481557        case 'post-formats':
    15491558            // specific post formats can be registered by passing an array of types to
Note: See TracChangeset for help on using the changeset viewer.