File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -969,7 +969,8 @@ public function show_screen_options() {
969969
970970 switch ( $ this ->id ) {
971971 case 'widgets ' :
972- $ this ->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on"> ' . __ ('Enable accessibility mode ' ) . '</a><a id="access-off" href="widgets.php?widgets-access=off"> ' . __ ('Disable accessibility mode ' ) . "</a></p> \n" ;
972+ $ nonce = wp_create_nonce ( 'widgets-access ' );
973+ $ this ->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on&_wpnonce= ' . urlencode ( $ nonce ) . '"> ' . __ ('Enable accessibility mode ' ) . '</a><a id="access-off" href="widgets.php?widgets-access=off&_wpnonce= ' . urlencode ( $ nonce ) . '"> ' . __ ('Disable accessibility mode ' ) . "</a></p> \n" ;
973974 break ;
974975 default :
975976 $ this ->_screen_settings = '' ;
Original file line number Diff line number Diff line change 1717
1818$ widgets_access = get_user_setting ( 'widgets_access ' );
1919if ( isset ($ _GET ['widgets-access ' ]) ) {
20+ check_admin_referer ( 'widgets-access ' );
21+
2022 $ widgets_access = 'on ' == $ _GET ['widgets-access ' ] ? 'on ' : 'off ' ;
2123 set_user_setting ( 'widgets_access ' , $ widgets_access );
2224}
You can’t perform that action at this time.
0 commit comments