mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user