Make use of specific post format support in current_theme_supports(). See #18691.

git-svn-id: http://svn.automattic.com/wordpress/trunk@18721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
duck_ 2011-09-19 16:31:33 +00:00
parent 6e2ffdc289
commit 5a4061bb13
2 changed files with 10 additions and 19 deletions

View File

@ -191,16 +191,11 @@ function edit_post( $post_data = null ) {
}
// Post Formats
if ( current_theme_supports( 'post-formats' ) && isset( $post_data['post_format'] ) ) {
$formats = get_theme_support( 'post-formats' );
if ( is_array( $formats ) ) {
$formats = $formats[0];
if ( in_array( $post_data['post_format'], $formats ) ) {
set_post_format( $post_ID, $post_data['post_format'] );
} elseif ( '0' == $post_data['post_format'] ) {
set_post_format( $post_ID, false );
}
}
if ( isset( $post_data['post_format'] ) ) {
if ( current_theme_supports( 'post-formats', $post_data['post_format'] ) )
set_post_format( $post_ID, $post_data['post_format'] );
elseif ( '0' == $post_data['post_format'] )
set_post_format( $post_ID, false );
}
// Meta Stuff

View File

@ -63,15 +63,11 @@ function press_it() {
wp_die($upload);
} else {
// Post formats
if ( current_theme_supports( 'post-formats' ) && isset( $_POST['post_format'] ) ) {
$post_formats = get_theme_support( 'post-formats' );
if ( is_array( $post_formats ) ) {
$post_formats = $post_formats[0];
if ( in_array( $_POST['post_format'], $post_formats ) )
set_post_format( $post_ID, $_POST['post_format'] );
elseif ( '0' == $_POST['post_format'] )
set_post_format( $post_ID, false );
}
if ( isset( $_POST['post_format'] ) ) {
if ( current_theme_supports( 'post-formats', $_POST['post_format'] ) )
set_post_format( $post_ID, $_POST['post_format'] );
elseif ( '0' == $post_data['post_format'] )
set_post_format( $post_ID, false );
}
wp_update_post($post);