看起来你可以ocean_main_metabox_capabilities
过滤器:
定义见/plugins/ocean-extra/includes/metabox/metabox.php
:
$capabilities = apply_filters( \'ocean_main_metaboxes_capabilities\', \'manage_options\' );
在您的子主题或自定义插件中,尝试以下操作(例如,在
/themes/mytheme/functions.php
:
add_filter( \'ocean_main_metaboxes_capabilities\', \'my_custom_metabox_role\' );
/**
* Change the default role used to display the Ocean Extra metabox.
*
* @param string $role The role to use, defaults to \'manage_options\' (Administrator).
* @return string
*/
function my_custom_metabox_role( $role ) {
if ( ! current_user_can( \'publish_posts\' ) ) {
return $role;
}
return \'publish_posts\';
}