Make WordPress Core

Ticket #28090: 28090.diff

File 28090.diff, 1.7 KB (added by ericlewis, 11 years ago)
  • src/wp-admin/edit-form-advanced.php

    diff --git a/src/wp-admin/edit-form-advanced.php b/src/wp-admin/edit-form-advanced.php
    index 8dc4815..84fcf60 100644
    a b if ( post_type_supports($post_type, 'editor') ) { 
    488488<?php wp_editor( $post->post_content, 'content', array(
    489489        'dfw' => true,
    490490        'drag_drop_upload' => true,
    491         'tabfocus_elements' => 'insert-media-button,save-post',
     491        'tabfocus_elements' => 'insert-media-button-1,save-post',
    492492        'editor_height' => 360,
    493493        'tinymce' => array(
    494494                'resize' => false,
  • src/wp-admin/includes/media.php

    diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php
    index cda0638..17536c4 100644
    a b document.body.className = document.body.className.replace('no-js', 'js'); 
    514514 * @param string $editor_id
    515515 */
    516516function media_buttons($editor_id = 'content') {
     517        static $instance; $instance = $instance ? $instance : 0; $instance++;
     518
    517519        $post = get_post();
    518520        if ( ! $post && ! empty( $GLOBALS['post_ID'] ) )
    519521                $post = $GLOBALS['post_ID'];
    function media_buttons($editor_id = 'content') { 
    524526
    525527        $img = '<span class="wp-media-buttons-icon"></span> ';
    526528
    527         echo '<a href="#" id="insert-media-button" class="button insert-media add_media" data-editor="' . esc_attr( $editor_id ) . '" title="' . esc_attr__( 'Add Media' ) . '">' . $img . __( 'Add Media' ) . '</a>';
    528 
     529        printf( '<a href="#" id="insert-media-button-%d" class="button insert-media add_media" data-editor="%s" title="%s">%s</a>',
     530                $instance,
     531                esc_attr( $editor_id ),
     532                esc_attr__( 'Add Media' ),
     533                $img . __( 'Add Media' ) );
    529534        /**
    530535         * Filter the legacy (pre-3.5.0) media buttons.
    531536         *