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:
markjaquith
2010-11-04 07:41:07 +00:00
parent c9190e667c
commit 17fbb0e123
9 changed files with 81 additions and 5 deletions

View File

@@ -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 )