mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-09 07:04:34 +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:
@@ -487,21 +487,19 @@ function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
|
||||
|
||||
$cpts = (array) get_post_types( array( 'show_in_admin_bar' => true ), 'objects' );
|
||||
|
||||
if ( isset( $cpts['post'] ) && current_user_can( $cpts['post']->cap->edit_posts ) ) {
|
||||
if ( isset( $cpts['post'] ) && current_user_can( $cpts['post']->cap->edit_posts ) )
|
||||
$actions[ 'post-new.php' ] = array( $cpts['post']->labels->name_admin_bar, 'new-post' );
|
||||
unset( $cpts['post'] );
|
||||
}
|
||||
|
||||
if ( current_user_can( 'upload_files' ) )
|
||||
$actions[ 'media-new.php' ] = array( _x( 'Media', 'add new from admin bar' ), 'new-media' );
|
||||
if ( isset( $cpts['attachment'] ) && current_user_can( 'upload_files' ) )
|
||||
$actions[ 'media-new.php' ] = array( $cpts['attachment']->labels->name_admin_bar, 'new-media' );
|
||||
|
||||
if ( current_user_can( 'manage_links' ) )
|
||||
$actions[ 'link-add.php' ] = array( _x( 'Link', 'add new from admin bar' ), 'new-link' );
|
||||
|
||||
if ( isset( $cpts['page'] ) && current_user_can( $cpts['page']->cap->edit_posts ) ) {
|
||||
if ( isset( $cpts['page'] ) && current_user_can( $cpts['page']->cap->edit_posts ) )
|
||||
$actions[ 'post-new.php?post_type=page' ] = array( $cpts['page']->labels->name_admin_bar, 'new-page' );
|
||||
unset( $cpts['page'] );
|
||||
}
|
||||
|
||||
unset( $cpts['post'], $cpts['page'], $cpts['attachment'] );
|
||||
|
||||
// Add any additional custom post types.
|
||||
foreach ( $cpts as $cpt ) {
|
||||
|
||||
Reference in New Issue
Block a user