Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php wp Advance自定义字段-默认选择取决于另一个阵列的选择_Php_Wordpress - Fatal编程技术网

Php wp Advance自定义字段-默认选择取决于另一个阵列的选择

Php wp Advance自定义字段-默认选择取决于另一个阵列的选择,php,wordpress,Php,Wordpress,我的用户可以选择不同类型的站点标题,有三种选择相互结合 我有一个“完整”和“居中”标题-当他们选择“完整”时,我希望我的另一个选择是“渐变”,但当他们更改为“居中”时,我希望默认值是“浅实心”。我在wordpress和高级定制领域没有经验 这是我的密码: if(function_exists("register_field_group")) { register_field_group(array ( 'id' => 'acf_post-style',

我的用户可以选择不同类型的站点标题,有三种选择相互结合

我有一个“完整”和“居中”标题-当他们选择“完整”时,我希望我的另一个选择是“渐变”,但当他们更改为“居中”时,我希望默认值是“浅实心”。我在wordpress和高级定制领域没有经验

这是我的密码:

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,
            ),
我能做一个改变这个的函数吗?如果是,如何获取这些阵列