[wp-trac] [WordPress Trac] #44511: Widgets generated by wp_register_sidebar_widget can not be add via customizer
WordPress Trac
noreply at wordpress.org
Wed Jul 4 10:47:29 UTC 2018
#44511: Widgets generated by wp_register_sidebar_widget can not be add via
customizer
--------------------------+-----------------------------
Reporter: bastho | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: 4.9.6
Severity: major | Keywords:
Focuses: |
--------------------------+-----------------------------
Single use widgets, generated by `wp_register_sidebar_widget` and managed
by `wp_register_widget_control` always return an "Invalid value" error in
Customizer. They also block saving in Customizer.
**We still can add them via appearance/widgets.php and go back to
customizer.**
Example to reproduce:
{{{#!php
<?php
add_action('widgets_init', 'proof_of_concept_register_widget');
function proof_of_concept_register_widget(){
wp_register_sidebar_widget(
'poc_widget',
'POC Widget',
'poc_widget_display',
array(
'description' => 'POC for Customize bug'
)
);
wp_register_widget_control('poc_widget', 'poc_widget',
'poc_widget_control');
}
function poc_widget_display(){
echo '<p>POC for Customize bug</p>';
}
function poc_widget_control(){
echo '<p>You should see a red notice "Invalid value" just above</p>';
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44511>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list