add_theme_support( 'post-formats', array( 'aside', 'image', 'etc' ) ); Add UI for choosing a post format, and save the choice. see #14746
git-svn-id: http://svn.automattic.com/wordpress/trunk@16174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -177,6 +177,19 @@ 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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Meta Stuff
|
||||
if ( isset($post_data['meta']) && $post_data['meta'] ) {
|
||||
foreach ( $post_data['meta'] as $key => $value )
|
||||
|
||||
Reference in New Issue
Block a user