晚上好,
我在Redux框架(3.1.9版)中有以下选项:
array(
'id' => 'social-networks',
'type' => 'sortable',
'mode' => 'checkbox',
'title' => __('Order Social Icons', 'options'),
'subtitle' => __('Order and activate/deactivate social icons', 'options'),
'options' => array(
'fb' => 'Facebook',
'tw' => 'Twitter',
'lin' => 'LinkedIn',
)
),输出(如果检查了所有三个选项)是:
[fb] => 1
[tw] => 1
[lin] => 1在此选项之后,我希望为列表中的每个选中的社交网络显示一个文本字段,并且我有示例文本输入:
array(
'id' => 'facebook-url',
'type' => 'text',
'required' => array('social-networks["fb"]','equals','1'),
'title' => __('Facebook URL', 'options'),
'subtitle' => __('Enter your Facebook URL.', 'options'),
),当然,“必需”的论点是行不通的。
是否有一种方法可以通过使用字段中的选项而不仅仅是ID来使用此参数。
谢谢
发布于 2014-05-11 21:50:11
根据http://docs.reduxframework.com/redux-framework/arguments/required/,您的条件选项应该如下所示:
array(
'id' => 'facebook-url',
'type' => 'text',
'required' => array('social-networks','equals','fb'),
'title' => __('Facebook URL', 'options'),
'subtitle' => __('Enter your Facebook URL.', 'options'),
),下一个选择:
array(
'id' => 'twitter-url',
'type' => 'text',
'required' => array('social-networks','equals','tw'),
'title' => __('Twitter URL', 'options'),
'subtitle' => __('Enter your twitter URL.', 'options'),
),诸若此类。
https://stackoverflow.com/questions/22672922
复制相似问题