$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,//Pass the $wp_customize object (required)
'user_theme_name',//Set a unique ID for the control
array(
'label' => __( 'Select Theme Name','user' ),//Admin-visible name of the control
'description' => __( 'Using this option you can change the user' ),'settings' => 'bootstrap_theme_name',//Which setting to load and manipulate (serialized is okay)
'priority' => 10,//Determines the order this control appears in for the specified section
'section' => 'user_options',//ID of the section this control should render in (can be one of yours,or a WordPress default section)
'type' => 'select','choices' => array(
'default' => 'admin','cerulean' => 'Cerulean','cosmo' => 'Cosmo','cyborg' => 'cyborg',)
)
) );
我已经在自定义主题中创建了一个下拉菜单,但是我无法获取用户列表并将其放在下拉菜单中。我尝试添加此钩子$ users = get_users(array('fields'=> array('ID')));并替换$ user数组对象中的选择,但未显示。我只想吸引所有用户并加入下拉菜单。
我需要在下拉菜单中显示所有用户 screenshot of the customize theme