Make WordPress Core

Changes between Version 6 and Version 7 of Ticket #14686, comment 12


Ignore:
Timestamp:
04/01/2013 02:29:47 PM (12 years ago)
Author:
dgwyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14686, comment 12

    v6 v7  
    55Seeing as this extra XHR request fires ONLY the first time a widget is dragged into a widget area I think it's an acceptable fix.
    66
    7 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).
     7Obviously it would be preferable to have the form HTML returned along with the first XHR request but it seems this is not possible without some fundamental changes to the widget code (see comment 9 from azaozz).
    88
    99It '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.