vafour / vafpress-framework

Wordpress theme options framework, check out the demo.
http://demo.vafpress.com/vafpress-framework
Other
240 stars 98 forks source link

checkbox default value not sets #88

Open padalec opened 10 years ago

padalec commented 10 years ago

Hi all, I founded bug when I tried to set default value for checkbox. Example:

array(
           'type'          => 'checkbox',
           'name'          => 'example',
           'label'         => 'example,
           'items'         => array(1,2,3,4),
           'default'       => array(1),
       );

this doesn't work. But I found fixes for this in /views/control/checbox.php line 5 from:

$checked = (in_array($item->value, $value));

should be replaced to:

$checked = (in_array($item->value, $default));

Regards

padalec commented 10 years ago

But my fix doesn't work when request is send by AJAX