How to check multiple checkbox options by default?

I need to have the options “Twitter, Facebook and Google Plus” selected by default. Here’s the part of the code :

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'
                    )
                ),

Plugin used: ContestHopper for WordPress

Read More

(Github source)

Related posts

Leave a Reply