Make WordPress Core

Ticket #18027: 18027.diff

File 18027.diff, 2.3 KB (added by nacin, 14 years ago)
  • wp-includes/theme.php

     
    19351935                        // any type is accepted
    19361936                        if ( true === $_wp_theme_features[$feature] )  // Registered for all types
    19371937                                return true;
    1938                         $content_type = $args[0];
    1939                         if ( in_array($content_type, $_wp_theme_features[$feature][0]) )
     1938                        $content_type  = $args[0];
     1939                        // accept array( 'types' => array( 'post', 'page' ) ), array( 'types' => 'post' ), and
     1940                        // array( 'types' => true ), with a fallback to original array( 'post', 'page' ).
     1941                        if ( isset( $_wp_theme_features[ $feature ][0]['types'] ) )
     1942                                $content_types = $_wp_theme_features[ $feature ][0]['types'];
     1943                        elseif ( isset( $_wp_theme_features[ $feature ][0][0] ) )
     1944                                $content_types = $_wp_theme_features[ $feature ][0];
     1945                        else
    19401946                                return true;
    1941                         else
    1942                                 return false;
     1947                        if ( true === $content_types )
     1948                                return true;
     1949                        return in_array( $content_type, (array) $content_types );
    19431950                        break;
    19441951        }
    19451952
  • wp-content/themes/twentyeleven/functions.php

     
    107107        add_custom_background();
    108108
    109109        // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images
    110         add_theme_support( 'post-thumbnails' );
     110        add_theme_support( 'post-thumbnails', array( 'usage' => __( 'Usage for Twenty Eleven goes here.', 'twentyeleven' ) ) );
    111111
    112112        // The next four constants set how Twenty Eleven supports custom headers.
    113113
  • wp-admin/includes/meta-boxes.php

     
    913913 */
    914914function post_thumbnail_meta_box() {
    915915        global $post;
     916        $theme_support = (array) get_theme_support( 'post-thumbnails' );
     917        if ( isset( $theme_support[0]['usage'] ) )
     918                echo '<p>' . $theme_support[0]['usage'] . '</p>';
    916919        $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
    917920        echo _wp_post_thumbnail_html( $thumbnail_id );
    918921}