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: https://develop.svn.wordpress.org/trunk@16196 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
419c42838b
commit
c44eb74f66
@ -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();
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user