Use post_type_supports() to check for whether a post type supports post formats. Only posts support it by default. props mikeschinkel. see #14746

git-svn-id: http://svn.automattic.com/wordpress/trunk@16196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2010-11-05 02:04:22 +00:00
parent 0bfee7db48
commit 920bfad390
2 changed files with 2 additions and 2 deletions

View File

@ -155,7 +155,7 @@ echo esc_html( $visibility_trans ); ?></span>
</div><?php // /misc-pub-section ?>
<?php
if ( 'post' == $post->post_type && current_theme_supports( 'post-formats' ) ) :
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :
$post_formats = get_theme_support( 'post-formats' );
$post_formats_display = get_post_format_strings();

View File

@ -24,7 +24,7 @@ function create_initial_post_types() {
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'sticky', 'trackbacks', 'custom-fields', 'comments', 'revisions' ),
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'sticky', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats' ),
) );
register_post_type( 'page', array(