[wp-trac] [WordPress Trac] #41536: Text widgets don't show editor anymore, only expand to show delete/close options
WordPress Trac
noreply at wordpress.org
Thu Aug 3 05:03:23 UTC 2017
#41536: Text widgets don't show editor anymore, only expand to show delete/close
options
-------------------------------+--------------------
Reporter: sseepuri | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.8.2
Component: Widgets | Version: 4.8
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+--------------------
Comment (by westonruter):
In short, I discovered that the JS for the rich Text widget is not
accounting for widgets that extend `WP_Widget_Text`, and give the extended
widgets different ID bases. When a widget extends the Text widget in this
way, it shows without the editor.
An easy way to reproduce this is to add a plugin (drop the following into
`mu-plugins`) that does:
{{{#!php
<?php
require_once ABSPATH . '/wp-includes/widgets/class-wp-widget-text.php';
class Extended_Text_Widget extends WP_Widget_Text {
function __construct() {
parent::__construct();
$this->id_base = 'extended_text';
$this->name = __( 'Extended Text' );
$this->option_name = 'widget_' . $this->id_base;
$this->widget_options['description'] = __( 'Extended
arbitrary text.' );
$this->control_options['id_base'] = $this->id_base;
}
}
add_action( 'widgets_init', function() {
register_widget( 'Extended_Text_Widget' );
} );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41536#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list