mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
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: https://develop.svn.wordpress.org/trunk@16174 602fd350-edb4-49c9-b593-d223f7449a82
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