WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/20/2017 04:38:35 PM (4 years ago)
Author:
westonruter
Message:

Code Editor: Improve ability to create Customizer CodeEditorControl instances in JS, lessening PHP dependencies.

Allow CodeEditorControl to be instantiated with a editor_settings param which is merged with wp.codeEditor.defaultSettings.

Also:

  • Turn redundant "CSS Code" control label into screen reader text for Additional CSS.
  • Remove code-editor as script dependency for custom-html-widgets since enqueueing is determined by wp_enqueue_code_editor().
  • Remove useless exporting of code_type param to JS in WP_Customize_Code_Editor_Control.
  • Add disabled class to Custom HTML widget's Save button when linting errors are present.
  • Remove redundant span inside CodeEditorControl's label.

See #41897, #12423, #41872.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/widgets/custom-html-widget.php

    r41858 r41957  
    264264
    265265        $this->assertTrue( wp_script_is( 'custom-html-widgets', 'enqueued' ) );
    266         $this->assertTrue( wp_script_is( 'code-editor', 'enqueued' ) );
    267         $this->assertTrue( wp_script_is( 'wp-codemirror', 'enqueued' ) );
     266        $this->assertFalse( wp_script_is( 'code-editor', 'enqueued' ) );
     267        $this->assertFalse( wp_script_is( 'wp-codemirror', 'enqueued' ) );
    268268        $this->assertFalse( wp_script_is( 'csslint', 'enqueued' ) );
    269269        $this->assertFalse( wp_script_is( 'jshint', 'enqueued' ) );
Note: See TracChangeset for help on using the changeset viewer.