1
我试图创建在WordPress主题定制区域选择框/下拉菜单,选项是从一个叫在从我的WordPress的数据库名为“wp_revslider_sliders”表“别名”列中提取。wordpress主题定制下拉
我已经创建了该部分,以及下拉菜单的基本设置和控制(请参见下面的图1),但作为该领域的新手,我无法弄清楚如何查询Wordpress DB从表中的我的“wp_revslider_sliders”的“别名”列中提取的结果,并把它们插入输出中的“选择阵列”下方
图1
$wp_customize->add_control(
'select_revslider',
array(
'type' => 'select',
'label' => 'Please Select a Slider:',
'section' => 'example_section_one',
'choices' => array(
'wordpress' => 'WordPress',
),
)
);
图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',
),
)
);
找到了回答我自己的问题,张贴这里的解决方案:http://wordpress.stackexchange.com/questions/258233/q-how-to-pull-data-from-custom-table-to-populate-zustomizer-setting-control- SEL/258240#258240 – user2286485