Php 如何默认选中多个复选框选项?
我需要在默认情况下选择选项“Twitter、Facebook和Google Plus”。以下是代码的一部分:Php 如何默认选中多个复选框选项?,php,wordpress,checkbox,Php,Wordpress,Checkbox,我需要在默认情况下选择选项“Twitter、Facebook和Google Plus”。以下是代码的一部分: function setup_settings() { $this->boxes = array( 'ch_box_settings' => array( 'title' => __('Widget Settings', 'contesthopper'), 'fields' =>
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'
)
),
使用的插件:
()如果您在网页上使用了此功能,请右键单击小部件并选择inspect element。如果复选框具有ID或容器具有ID,则可以使用javascript将该元素中的所有复选框元素作为目标。我想猜测一下,Chu social=容器,Chu box\u twitter要么是这个盒子的容器,要么是元素的id。你试过/能用javascript吗?