Php wp Advance自定义字段-默认选择取决于另一个阵列的选择
我的用户可以选择不同类型的站点标题,有三种选择相互结合 我有一个“完整”和“居中”标题-当他们选择“完整”时,我希望我的另一个选择是“渐变”,但当他们更改为“居中”时,我希望默认值是“浅实心”。我在wordpress和高级定制领域没有经验 这是我的密码:Php wp Advance自定义字段-默认选择取决于另一个阵列的选择,php,wordpress,Php,Wordpress,我的用户可以选择不同类型的站点标题,有三种选择相互结合 我有一个“完整”和“居中”标题-当他们选择“完整”时,我希望我的另一个选择是“渐变”,但当他们更改为“居中”时,我希望默认值是“浅实心”。我在wordpress和高级定制领域没有经验 这是我的密码: if(function_exists("register_field_group")) { register_field_group(array ( 'id' => 'acf_post-style',
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_post-style',
'title' => __('Post style', 'crisp'),
'fields' => array (
array (
'key' => 'field_56a21897616b9',
'label' => __('Top image style', 'crisp'),
'name' => 'crisp_top_image',
'type' => 'select',
'required' => 1,
'choices' => array (
'centered' => 'Centered image',
'full' => 'Full screen image',
),
'default_value' => 'centered',
'allow_null' => 0,
'multiple' => 0,
),
array (
'key' => 'field_56a218f9616ba',
'label' => __('Header text background', 'crisp'),
'name' => 'crisp_text_bg',
'type' => 'select',
'required' => 1,
'choices' => array (
'light-solid' => 'Light solid background',
'light-transparent' => 'Transparent light backgrund',
'dark-transparent' => 'Transparent dark background',
'gradient' => 'Gradient background',
'none' => 'No background',
),
'default_value' => 'gradient', // I want this one to change
'allow_null' => 0,
'multiple' => 0,
),
我能做一个改变这个的函数吗?如果是,如何获取这些阵列