Edit screen UI for post formats: a first run for functionality.

* Adds a very basic tabbed interface for selecting a post format (requires JS).
* Extra fields, which are post meta, are shown/hidden based on the selected format.
* Introduce a helper function for retrieving formats-specific metadata: `get_post_format_meta()`.
* Image selection uses the media modal, although without filtering or from URL support at the moment.

props rachelbaker, wonderboymusic, aaroncampbell, helen. see #19570.


git-svn-id: https://develop.svn.wordpress.org/trunk@23449 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi
2013-02-18 19:11:24 +00:00
parent edd0530290
commit 5b3c058bd5
7 changed files with 262 additions and 10 deletions
+24
View File
@@ -1950,6 +1950,30 @@ function get_post_custom_values( $key = '', $post_id = 0 ) {
return isset($custom[$key]) ? $custom[$key] : null;
}
/**
* Retrieve post format metadata for a post
*
* @since 3.6.0
*
* @param int $post_id
* @return null
*/
function get_post_format_meta( $post_id = 0 ) {
$values = array(
'quote' => '',
'quote_source' => '',
'image' => '',
'url' => '',
'gallery' => '',
'media' => '',
);
foreach ( $values as $key => $value )
$values[$key] = get_post_meta( $post_id, '_wp_format_' . $key, true );
return $values;
}
/**
* Check if post is sticky.
*