Skip to content

Commit 588188b

Browse files
Options, Meta APIs: Avoid bypassing the option_page_capability_options filter.
This ensures that the filter is available when `wp-admin/options.php` is accessed directly. Follow-up to [13627], [17986], [25372]. Props amibe. Fixes #58761. Built from https://develop.svn.wordpress.org/trunk@61325 git-svn-id: http://core.svn.wordpress.org/trunk@60637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 01db8eb commit 588188b

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

wp-admin/options.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@
3131
// This is for back compat and will eventually be removed.
3232
if ( empty( $option_page ) ) {
3333
$option_page = 'options';
34-
} else {
35-
36-
/**
37-
* Filters the capability required when using the Settings API.
38-
*
39-
* By default, the options groups for all registered settings require the manage_options capability.
40-
* This filter is required to change the capability required for a certain options page.
41-
*
42-
* @since 3.2.0
43-
*
44-
* @param string $capability The capability used for the page, which is manage_options by default.
45-
*/
46-
$capability = apply_filters( "option_page_capability_{$option_page}", $capability );
4734
}
4835

36+
/**
37+
* Filters the capability required when using the Settings API.
38+
*
39+
* By default, the options groups for all registered settings require the manage_options capability.
40+
* This filter is required to change the capability required for a certain options page.
41+
*
42+
* @since 3.2.0
43+
* @since 7.0.0 Applied when `wp-admin/options.php` is accessed directly.
44+
*
45+
* @param string $capability The capability used for the page, which is manage_options by default.
46+
*/
47+
$capability = apply_filters( "option_page_capability_{$option_page}", $capability );
48+
4949
if ( ! current_user_can( $capability ) ) {
5050
wp_die(
5151
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '7.0-alpha-61324';
19+
$wp_version = '7.0-alpha-61325';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)