如何默认选中多个复选框选项?

时间:2015-02-16 00:15:27

标签: php wordpress checkbox

我需要默认选择“Twitter,Facebook和Google Plus”选项。这是代码的一部分:

function setup_settings()
{        
    $this->boxes = array(
        'ch_box_settings' => array(
            'title' => __('Widget Settings', 'contesthopper'),
            'fields' => array(
                'ch_social' => array(
                    'id' => 'ch_social',
                    'type' => 'checkbox',
                    'title' => __('Social buttons', 'contesthopper'),
                    'description' => __('Select the checkboxes above to display social share buttons after you capture an email.', 'contesthopper'),
                    'options' => array(
                        'twitter' => 'Twitter',
                        'facebook' => 'Facebook',
                        'googleplus' => 'Google+',
                        'linkedin' => 'LinkedIn',
                        'pinit' => 'Pinterest'
                    ),
                    'conditional' => array(
                        'twitter' => 'ch_box_twitter',
                        'facebook' => 'ch_box_facebook',
                        'linkedin' => 'ch_box_linkedin',
                        'pinit' => 'ch_box_pinit'
                    )
                ),

使用的插件:ContestHopper for WordPress

Github source

0 个答案:

没有答案