| 开发者 | jjcm1962 |
|---|---|
| 更新时间 | 2026年10月9日 06:31 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
manage_options — the
standard edit_theme_options capability, which the Editor role
normally lacks, is not enough: an Editor with only
edit_theme_options still sees just the native WordPress panels
(Site Identity, Menus, Widgets, Additional CSS), not Kadence's own
panels.
This plugin solves that by granting manage_options to Editor users,
but in a tightly scoped way:
user_has_cap
filter only for the duration of the current HTTP request./wp/v2/settings or
/wp/v2/themes. The mere presence of a URL parameter is never
enough on its own — this prevents an Editor from obtaining
manage_options on other wp-admin pages simply by tampering with
the query string.manage_options nowhere
else: they remain without access to Plugins, Users, or any other page
that depends on that capability.
Nothing is written to the database
add_cap() call on the WP_Role object, in any
activation, deactivation, or admin_init hook.register_setting, update_option, or
update_user_meta anywhere in the plugin.etak_grant_theme_access filter in a must-use plugin or in the
theme's functions.php — without modifying this plugin:
add_filter( 'etak_grant_theme_access', function ( $grant, $user ) {
return in_array( $user->ID, array( 5, 12 ), true );
}, 10, 2 );
You can also adjust the AJAX actions and REST routes recognized as
Customizer/Kadence context through the etak_customizer_ajax_actions
and etak_customizer_rest_routes filters — useful if your site has
additional Kadence-related integrations using different actions or
routes than the defaults.
If your Kadence installation (or a variant of it) uses a different
theme slug, adjust it with etak_kadence_theme_slugs:
add_filter( 'etak_kadence_theme_slugs', function ( $slugs ) {
return array_merge( $slugs, array( 'my-kadence-slug' ) );
} );
editor-theme-access-for-kadence folder to the
/wp-content/plugins/ directory, or install the plugin directly
from the "Plugins" screen in WordPress.Because Kadence, for its own panels (Header, Footer, Colors & Fonts,
General, Posts/Pages Layout, Homepage Settings), internally checks a
capability that only manage_options satisfies. edit_theme_options
alone only reveals the native WordPress panels (Site Identity, Menus,
Widgets, Additional CSS).
The elevation only exists during verified (nonce-checked) Customizer
requests — never persistently or globally. An Editor does not gain
manage_options by visiting Plugins, Users, or any other wp-admin
page; only inside the Customizer screen itself and the requests it
generates. That said, it is still a real elevation: an Editor with
Customizer access can change any setting that lives there (including,
for example, "Additional CSS", which accepts arbitrary CSS, or panels
from other plugins that also depend on manage_options and appear in
the Customizer). Weigh this trade-off before activating the plugin on
a site with multiple Editors.
No. The plugin checks, on every request, whether the active theme
(get_template()) is kadence; if it isn't, it does nothing at all.
You can leave it always active, even on sites that don't use Kadence,
or switch themes without worrying about deactivating it first.
No, under any circumstance. It is recalculated on every request
through the user_has_cap filter.
Yes, via the etak_grant_theme_access filter (see the Description
section) in a must-use plugin or the theme's functions.php — no
need to modify this plugin.
No. This is an independent, third-party plugin with no affiliation with Kadence WP.