I am trying to create a select box/dropdown menu in the Wordpress theme customization area where the options are to be extracted from a column called "alias" in a table named "wp_revslider_sliders" from my Wordpress DB.
I have already created the section, and the basic setting and control for the drop down menu (see Fig. 1 below), but being a novice in this area, I can't figure out how to query the Wordpress DB, extract the results from the "Alias" column of my "wp_revslider_sliders" table and insert them output in to the "choices array" below
Fig. 1
$wp_customize->add_control(
'select_revslider',
array(
'type' => 'select',
'label' => 'Please Select a Slider:',
'section' => 'example_section_one',
'choices' => array(
'wordpress' => 'WordPress',
),
)
);
Fig. 2
function example_customizer( $wp_customize ) {
$wp_customize->add_section(
'example_section_one',
array(
'title' => 'Example Settings',
'description' => 'This is a settings section.',
'priority' => 35,
)
);
$wp_customize->add_setting(
'select_revslider',
array(
'default' => 'wordpress',
)
);
$wp_customize->add_control(
'select_revslider',
array(
'type' => 'select',
'label' => 'Please Select a Slider:',
'section' => 'example_section_one',
'choices' => array(
'wordpress' => 'WordPress',
),
)
);