WordPress / better-code-editing

[✅ Merged into 4.9-alpha] Better Code Editing WordPress plugin
https://wordpress.org/plugins/better-code-editing/
37 stars 16 forks source link

Add CodeMirror to Custom HTML widget #21

Closed westonruter closed 7 years ago

westonruter commented 7 years ago

Fixes #9

Widgets admin screen:

screen shot 2017-08-11 at 14 05 33

Customizer:

screen shot 2017-08-11 at 14 04 52
westonruter commented 7 years ago

We also have the option to let this be a “wide widget”, if we want to go there:

custom-html-wide-widget
diff --git src/wp-admin/js/customize-widgets.js src/wp-admin/js/customize-widgets.js
index df4c8d777b..ba9e3d1b43 100644
--- src/wp-admin/js/customize-widgets.js
+++ src/wp-admin/js/customize-widgets.js
@@ -602,7 +602,7 @@
            $customizeSidebar = $( '.wp-full-overlay-sidebar-content:first' );
            this.container.addClass( 'wide-widget-control' );

-           this.container.find( '.widget-content:first' ).css( {
+           this.container.find( '.form:first' ).css( {
                'max-width': this.params.width,
                'min-height': this.params.height
            } );
diff --git src/wp-includes/class-wp-customize-widgets.php src/wp-includes/class-wp-customize-widgets.php
index 973411b520..707adc6c68 100644
--- src/wp-includes/class-wp-customize-widgets.php
+++ src/wp-includes/class-wp-customize-widgets.php
@@ -36,7 +36,6 @@ final class WP_Customize_Widgets {
        'archives',
        'calendar',
        'categories',
-       'custom_html',
        'links',
        'media_audio',
        'media_image',
westonruter commented 7 years ago

I'm going ahead and merging this and any review can be done afterward.