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:
parent
6e2ffdc289
commit
5a4061bb13
|
@ -191,17 +191,12 @@ 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 ) ) {
|
||||
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'] ) {
|
||||
elseif ( '0' == $post_data['post_format'] )
|
||||
set_post_format( $post_ID, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Meta Stuff
|
||||
if ( isset($post_data['meta']) && $post_data['meta'] ) {
|
||||
|
|
|
@ -63,16 +63,12 @@ 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 ) )
|
||||
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['post_format'] )
|
||||
elseif ( '0' == $post_data['post_format'] )
|
||||
set_post_format( $post_ID, false );
|
||||
}
|
||||
}
|
||||
|
||||
wp_update_post($post);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue