WordPress.org

Make WordPress Core

Ticket #27372: 27372.diff

File 27372.diff, 2.9 KB (added by imath, 6 years ago)
  • src/wp-admin/css/media.css

    diff --git src/wp-admin/css/media.css src/wp-admin/css/media.css
    index e92b1d4..f931570 100644
    border color while dragging a file over the uploader drop area */ 
    457457        margin: 8px 0;
    458458}
    459459
    460 .post-php .imgedit-wrap table {
     460.image-editor .imgedit-wrap table {
    461461        width: 100%;
    462462}
    463463
  • src/wp-includes/script-loader.php

    diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
    index 7849c30..02af933 100644
    function wp_default_scripts( &$scripts ) { 
    395395        $scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 );
    396396        $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models' ), false, 1 );
    397397
     398        // Having image-edit in the is_admin() part breaks the Add Media Button of wp_editor() on front end
     399        $scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), false, 1 );
     400        did_action( 'init' ) && $scripts->localize( 'image-edit', 'imageEditL10n', array(
     401                'error' => __( 'Could not load the preview image. Please reload the page and try again.' )
     402        ));
     403
    398404        if ( is_admin() ) {
    399405                $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('jquery', 'wp-ajax-response'), false, 1 );
    400406                did_action( 'init' ) && $scripts->localize( 'admin-tags', 'tagsl10n', array(
    function wp_default_scripts( &$scripts ) { 
    496502                        'error' => __( 'An error has occured. Please reload the page and try again.' )
    497503                ));
    498504
    499                 $scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), false, 1 );
    500                 did_action( 'init' ) && $scripts->localize( 'image-edit', 'imageEditL10n', array(
    501                         'error' => __( 'Could not load the preview image. Please reload the page and try again.' )
    502                 ));
    503 
    504505                $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 );
    505506                did_action( 'init' ) && $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array(
    506507                        'setThumbnail' => __( 'Use as featured image' ),
    function wp_default_styles( &$styles ) { 
    616617        $styles->add( 'wp-pointer',     "/wp-includes/css/wp-pointer$suffix.css", array( 'dashicons' ) );
    617618
    618619        // External libraries and friends
    619         $styles->add( 'imgareaselect',       '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.8' );
     620        $styles->add( 'imgareaselect',       '/wp-includes/js/imgareaselect/imgareaselect.css', array( 'wp-admin' ), '0.9.8' );
    620621        $styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array( 'dashicons' ) );
    621622        $styles->add( 'mediaelement',        "/wp-includes/js/mediaelement/mediaelementplayer.min.css", array(), '2.13.0' );
    622623        $styles->add( 'wp-mediaelement',     "/wp-includes/js/mediaelement/wp-mediaelement.css", array( 'mediaelement' ) );