Customizer options limited to specific user roles?


Is it possible to limit the selection of a specific customizer option to user roles?

Right now I have this custom control:

$wp_customize->add_control( 'checkin[theme]', array(
'label' => __('Theme', 'greet'),
// 'description' => 'Set theme',
'section' => 'checkin',
'type' => 'select',
'choices'  => array(
        'theme-1' => 'Background',
        'theme-2' => 'Stars (Live)',
        'theme-3' => 'Gradient (Live)',
) );

I would like to limit the theme-2 and theme-3 to only be available for a specific user role, and either be unavailable or greyed out/disabled for the other roles.

How do I do this with an array?

jockebq 3 months 0 Answers 15 views 0

Leave an answer