[wp-trac] [WordPress Trac] #14686: Widget Instance Form Update Bug
WordPress Trac
noreply at wordpress.org
Mon Apr 1 14:26:24 UTC 2013
#14686: Widget Instance Form Update Bug
---------------------------+-----------------------------
Reporter: digitalnature | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Widgets | Version: 3.0.1
Severity: normal | Resolution:
Keywords: needs-patch |
---------------------------+-----------------------------
Comment (by dgwyer):
Added a patch that fixes the issues described in this ticket. It basically
fires another XHR request when the widget is first dragged into a widget
area.
The patch along with the test widget code above works fine. Plus,
JS/jQuery is available to the widget, without having to manually click
Save, so you can do things like easily add jQuery tabs or toggle advanced
widget options.
Seeing as this extra XHR request fires ONLY the first time the widget is
dragged into a widget area I think it's an acceptable fix.
Obviously it would be preferable to have the form HTML returned along with
the first request but it seems this is not possible without some
fundamental changes to the widget code (see comment 9 from azaozz).
It 'almost' tantalizingly seems like this is possible looking at the code
in ajax-actions.php as the initial XHR request returns nothing back to
widgets.php. However there is no access to the global
$wp_registered_widget_controls variable in wp_ajax_save_widget() during
the initial XHR request so we can't just return the form HTML as a
response.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14686#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list