mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-15 07:05:37 +01:00
Add nonce for widget accessibility mode.
Props vortfu. See #23328. Merges [39760] to 4.7 branch. Built from https://develop.svn.wordpress.org/branches/4.7@39761 git-svn-id: http://core.svn.wordpress.org/branches/4.7@39699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d47305bfe4
commit
189e5449a3
@ -915,7 +915,8 @@ final class WP_Screen {
|
|||||||
|
|
||||||
switch ( $this->base ) {
|
switch ( $this->base ) {
|
||||||
case 'widgets':
|
case 'widgets':
|
||||||
$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";
|
$nonce = wp_create_nonce( 'widgets-access' );
|
||||||
|
$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";
|
||||||
break;
|
break;
|
||||||
case 'post' :
|
case 'post' :
|
||||||
$expand = '<fieldset class="editor-expand hidden"><legend>' . __( 'Additional settings' ) . '</legend><label for="editor-expand-toggle">';
|
$expand = '<fieldset class="editor-expand hidden"><legend>' . __( 'Additional settings' ) . '</legend><label for="editor-expand-toggle">';
|
||||||
|
@ -22,6 +22,8 @@ if ( ! current_user_can( 'edit_theme_options' ) ) {
|
|||||||
|
|
||||||
$widgets_access = get_user_setting( 'widgets_access' );
|
$widgets_access = get_user_setting( 'widgets_access' );
|
||||||
if ( isset($_GET['widgets-access']) ) {
|
if ( isset($_GET['widgets-access']) ) {
|
||||||
|
check_admin_referer( 'widgets-access' );
|
||||||
|
|
||||||
$widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
|
$widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
|
||||||
set_user_setting( 'widgets_access', $widgets_access );
|
set_user_setting( 'widgets_access', $widgets_access );
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.7.1-RC1-39750';
|
$wp_version = '4.7.1-RC1-39761';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user