Hello,
I’m trying to allow some Theme Customizer settings for the Editor user role.
I would like them to change site logo and edit the colors palette and hide the rest of the settings in customizer.
In Kadence Child theme functions.php I first gave Editor a permission that did reveal customizer for Editor:
This works:
function add_theme_caps() {
$role_object = get_role( 'editor' );
$role_object->add_cap( 'edit_theme_options' );
//apply_filters( 'kadence_theme_customizer_capability', 'manage_options' );
}
add_action( 'admin_init', 'add_theme_caps');
Then I have tried using customize_register -hook. I tried to set high number so it would run after the parent theme:
Does not work. Nothing seems to happen:
add_action('customize_register','my_customize_register', 9000);
function my_customize_register( $wp_customize ) {
//$wp_customize->get_setting( 'title_tagline' )->capability = 'edit_users';
$wp_customize->remove_section( 'general-layout' );
$wp_customize->remove_setting( 'general-layout' );
$wp_customize->remove_control( 'general-layout' );
$wp_customize->remove_panel( 'kadence_customizer_general' );
}
I even tried to use after_setup_theme -hook
function remove_custom() {
add_action(‘customize_register’,’my_customize_register’, 9000);
function my_customize_register( $wp_customize ) {
//$wp_customize->get_setting( ‘title_tagline’ )->capability = ‘edit_users’;
$wp_customize->remove_section( ‘general-layout’ );
$wp_customize->remove_setting( ‘general-layout’ );
$wp_customize->remove_control( ‘general-layout’ );
$wp_customize->remove_panel( ‘kadence_customizer_general’ );
}
}
add_action(‘after_setup_theme’, ‘remove_custom’);
Can you give me some pointer or example how to continue and hook into parent Kadence Theme Customizer?