[wp-trac] [WordPress Trac] #55220: Legacy widgets lack access to some usual server-side globals

WordPress Trac noreply at wordpress.org
Tue Feb 22 00:59:30 UTC 2022


#55220: Legacy widgets lack access to some usual server-side globals
--------------------------+-----------------------------
 Reporter:  noisysocks    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Widgets       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+-----------------------------

Comment (by noisysocks):

 I'm okay with spoofing these variables for the REST API endpoints that
 call into `WP_Widget::widget` and `WP_Widget::update`.

 {{{
 global $pagenow;
 $pagenow = 'widgets.php';
 $_POST['action'] = 'save-widget';
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55220#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list