mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Use the regular post type UI for editing single media items (attachments).
* Attachments now go through post.php, edit_post(), the like, and have show_ui set to true. * Taxonomies attached to the media library now appear in the admin menu (if show_ui). * Editing, cropping, uploading, etc. is still very rough, but mostly functional. API-wise: * New function: get_taxonomies_for_attachments(). Like get_taxonomies(), for taxonomies specifically registered against attachments. * Brings taxonomy support from the posts list table to the media list table. Expect them to converge soon. * wp_insert_attachment() now handles taxonomies like wp_insert_post(). Also expect them to converge soon. * New edit_form_after_title hook. props helenyhou, ocean90. see #21391. git-svn-id: https://develop.svn.wordpress.org/trunk@21948 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -235,6 +235,16 @@ function edit_post( $post_data = null ) {
|
||||
}
|
||||
}
|
||||
|
||||
// Attachment stuff
|
||||
if ( 'attachment' == $post_data['post_type'] && isset( $post_data['_wp_attachment_image_alt'] ) ) {
|
||||
$image_alt = get_post_meta( $post_ID, '_wp_attachment_image_alt', true );
|
||||
if ( $image_alt != stripslashes( $post_data['_wp_attachment_image_alt'] ) ) {
|
||||
$image_alt = wp_strip_all_tags( stripslashes( $post_data['_wp_attachment_image_alt'] ), true );
|
||||
// update_meta expects slashed
|
||||
update_post_meta( $post_ID, '_wp_attachment_image_alt', addslashes( $image_alt ) );
|
||||
}
|
||||
}
|
||||
|
||||
add_meta( $post_ID );
|
||||
|
||||
update_post_meta( $post_ID, '_edit_last', $GLOBALS['current_user']->ID );
|
||||
@@ -1064,7 +1074,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||
|
||||
list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
|
||||
|
||||
if ( 'publish' == $post->post_status ) {
|
||||
if ( 'publish' == get_post_status( $post ) ) {
|
||||
$ptype = get_post_type_object($post->post_type);
|
||||
$view_post = $ptype->labels->view_item;
|
||||
$title = __('Click to edit this part of the permalink');
|
||||
|
||||
Reference in New Issue
Block a user