mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Metadata for audio and video files:
* Make attachment metadata for audio files editable by providing a metabox on the Edit Media page * Standardize on using the attachment title everywhere * Label the Caption and Description fields for audio and video appropriately * Make the playlist Underscore templates more straightforward See #27574. git-svn-id: https://develop.svn.wordpress.org/trunk@27862 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -237,6 +237,24 @@ function edit_post( $post_data = null ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'attachment' === $post_data['post_type'] && preg_match( '#^audio|video#', $post_data['post_mime_type'] ) ) {
|
||||
$id3data = wp_get_attachment_metadata( $post_ID );
|
||||
if ( ! is_array( $id3data ) ) {
|
||||
$id3data = array();
|
||||
}
|
||||
|
||||
foreach ( wp_get_relevant_id3_keys() as $key => $label ) {
|
||||
if ( isset( $post_data[ 'id3_' . $key ] ) ) {
|
||||
if ( current_user_can( 'unfiltered_html' ) ) {
|
||||
$id3data[ $key ] = wp_unslash( $post_data[ 'id3_' . $key ] );
|
||||
} else {
|
||||
$id3data[ $key ] = wp_unslash( wp_kses_post( $post_data[ 'id3_' . $key ] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
wp_update_attachment_metadata( $post_ID, $id3data );
|
||||
}
|
||||
|
||||
// Meta Stuff
|
||||
if ( isset($post_data['meta']) && $post_data['meta'] ) {
|
||||
foreach ( $post_data['meta'] as $key => $value ) {
|
||||
|
||||
Reference in New Issue
Block a user