widget_fields();
$field_default = array(
'name' => '',
'title' => '',
'type' => 'text',
);
$extra_attributes = array();
// Loop through fields
foreach ($widget_fields as $field_key => $field) {
if (!isset($field['name']) || !isset($field['type'])) {
continue;
}
if ($field_key != $field['name']) {
continue;
}
$field = wp_parse_args($field, $field_default);
$value = isset($instance[$field_key]) ? $instance[$field_key] : ((isset($field['default']) && $field['type'] != 'checkbox') ? $field['default'] : '');
$extra_attributes = isset($field['extra_attributes']) ? $field['extra_attributes'] : array();
$extra_attribute_text = $this->get_extra_attribute_text($extra_attributes);
switch ($field['type']) {
case "title":
?>
description($field) ?>
/>
description($field) ?>
/>
description($field) ?>
/>
description($field) ?>
description($field) ?>
description($field) ?>
'name',
'hide_empty' => 0,
'class' => 'widefat',
'taxonomy' => 'category',
'selected' => is_array($value) ? implode(",", $value) : $value,
'name' => $this->get_field_name($field_key),
'id' => $this->get_field_id($field_key),
'show_option_all' => esc_html__('All Categories', 'agency-ecommerce'),
'echo' => false,
'multiple' => false
);
$cat_args = wp_parse_args($args, $cat_default_args);
?>
wp_dropdown_cats_multiple($output, $cat_args);
} else {
/* translators: 1: taxonomy */
echo '
' . sprintf(esc_html__('Taxonomy (%s) not found', 'agency-ecommerce'), $taxonomy) . '
';
}
$this->description($field) ?>
description($field) ?>
array(),
'em' => array(),
'strong' => array(),
'a' => array(
'href' => array(),
'target' => array(),
),
);
$updated_value = wp_kses($field['description'], $allowed_tags);
?>
$attribute_value) {
$extra_attribute_text .= ' ' . esc_html($attribute_key) . '="' . esc_attr($attribute_value) . '"';
}
return $extra_attribute_text;
}
public function update($new_instance, $old_instance)
{
$instance = $old_instance;
$widget_fields = $this->widget_fields();
$field_default = array(
'name' => '',
'title' => '',
'type' => 'text',
);
// Loop through fields
foreach ($widget_fields as $field_key => $field) {
if (!isset($field['name']) || !isset($field['type'])) {
continue;
}
if ($field_key != $field['name']) {
continue;
}
$field = wp_parse_args($field, $field_default);
$new_field_value = isset($new_instance[$field_key]) ? $new_instance[$field_key] : '';
$instance[$field['name']] = Agency_Ecommerce_Widget_Validation::instance()->sanitize($new_field_value, $field);
}
return $instance;
}
function wp_dropdown_cats_multiple($output, $r)
{
if (isset($r['multiple']) && $r['multiple']) {
$output = preg_replace('/^