コード例 #1
0
 public function __construct($name, $option_group, $id = '', $extra = '')
 {
     global $post;
     if ($post != '') {
         $option_group_value = get_post_meta($post->ID, $option_group, TRUE);
         $field_name = $option_group . '[' . $name . ']';
         $value = $option_group_value[$name];
     } else {
         $value = get_option($option_group . '_values');
         $this->option_group = $option_group;
         $field_name = $option_group . '_values[' . $name . ']';
         $value = $value[$name];
     }
     $checked = FALSE;
     if ($value != '') {
         $checked = TRUE;
     }
     parent::__construct($field_name, $value, $id, $checked, $extra);
 }
コード例 #2
0
function tk_form_checkbox($name, $value, $id = '', $checked = false, $extra = '')
{
    $textfield = new TK_FORM_CHECKBOX($name, $value, $id, $extra);
    return $textfield->get_html();
}