From 5faf09a26143e0000fbe2bec5b4a3b973d953efb Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 2 Sep 2014 09:08:16 +0000 Subject: [PATCH] Restore 'insert-media-button' as an ID attribute for the first instance of media_buttons(). Remove IDs for subsequent instances. props nacin. fixes #28090. Built from https://develop.svn.wordpress.org/trunk@29671 git-svn-id: http://core.svn.wordpress.org/trunk@29445 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-advanced.php | 2 +- wp-admin/includes/media.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 26b0cd96bf..ebda7a3f69 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -504,7 +504,7 @@ if ( post_type_supports($post_type, 'editor') ) { post_content, 'content', array( 'dfw' => true, 'drag_drop_upload' => true, - 'tabfocus_elements' => 'insert-media-button-1,save-post', + 'tabfocus_elements' => 'insert-media-button,save-post', 'editor_height' => 300, 'tinymce' => array( 'resize' => false, diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 3c30cd686e..2b9d5eb124 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -528,8 +528,9 @@ function media_buttons($editor_id = 'content') { $img = ' '; - printf( '%s', - $instance, + $id_attribute = $instance === 1 ? ' id="insert-media-button"' : ''; + printf( '%s', + $id_attribute, esc_attr( $editor_id ), esc_attr__( 'Add Media' ), $img . __( 'Add Media' )