File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -901,7 +901,8 @@ public function show_screen_options() {
901901
902902 switch ( $ this ->id ) {
903903 case 'widgets ' :
904- $ 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" ;
904+ $ nonce = wp_create_nonce ( 'widgets-access ' );
905+ $ 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" ;
905906 break ;
906907 default :
907908 $ 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