$attribute_value) {
$custom_attributes[] = esc_attr($attribute) . '="' . esc_attr($attribute_value) . '"';
}
}
return implode(' ', $custom_attributes);
}
public function generate_checkbox_field($key, $data)
{
$field_key = $this->get_field_key($key);
$defaults = array(
'title' => '',
'disabled' => false,
'class' => '',
'css' => '',
'placeholder' => '',
'type' => 'text',
'desc_tip' => false,
'description' => '',
'custom_attributes' => array(),
);
$data = wp_parse_args($data, $defaults);
ob_start();
?>
class="form-checkbox h-5 w-5 text-blue-600"
get_custom_attribute_html($data)); // WPCS: XSS ok.
?>>
get_field_key($key);
$data = wp_parse_args($data, [
'label' => '',
'value' => '',
'desc_tip' => false,
'description' => '',
'placeholder' => '',
'custom_attributes' => array(),
]);
ob_start();
?>
get_custom_attribute_html($data)); // WPCS: XSS ok.
?>
class="form-input mt-1 block w-full">
get_field_key($key);
$data = wp_parse_args($data, [
'label' => '',
'value' => '',
'options' => [],
'desc_tip' => false,
'description' => '',
]);
ob_start();
?>
' . wp_kses_post($data['description']) . '' ?>
get_field_key($key);
$data = wp_parse_args($data, [
'label' => '',
'value' => [],
'options' => [],
'desc_tip' => false,
'description' => '',
]);
ob_start();
?>
can_use_premium_code__premium_only();
foreach ($fields as $key => $field) {
$method = 'generate_' . $field['type'] . '_field';
$allow = empty($field['premium']) || $is_premium;
if (method_exists($this, $method) && $allow) {
echo $this->$method($key, $field);
}
}
}
}