0, 'label' => 'Select Categories' ); $sparklestore_posts = get_categories(); foreach ($sparklestore_posts as $sparklestore_post) : $sparklestore_category_list[$sparklestore_post->term_id] = array( 'value' => $sparklestore_post->term_id, 'label' => $sparklestore_post->name ); endforeach; extract($widget_field); switch ($sparklestore_widgets_field_type) { // Standard text field case 'text' : ?>




/>

'; foreach ($sparklestore_widgets_field_options as $sparklestore_option_name => $sparklestore_option_title) { ?> />





'; foreach ( $sparklestore_widgets_field_options as $sparklestore_option_name => $sparklestore_option_title) { if( isset( $sparklestore_field_value[$sparklestore_option_name] ) ) { $sparklestore_field_value[$sparklestore_option_name] = 1; }else{ $sparklestore_field_value[$sparklestore_option_name] = 0; } ?>

/>

'; if (isset($sparklestore_widgets_description)) { ?> get_field_id($sparklestore_widgets_name); $class = ''; $int = ''; $value = $sparklestore_field_value; $name = $instance->get_field_name($sparklestore_widgets_name); if ($value) { $class = ' has-file'; } $output .= '
'; $output .= '
'; $output .= '' . "\n"; if (function_exists('wp_enqueue_media')) { if (( $value == '')) { $output .= '' . "\n"; } else { $output .= '' . "\n"; } } else { $output .= '

' . __('Upgrade your version of WordPress for full media support.', 'sparklestore') . '

'; } $output .= '
' . "\n"; if ($value != '') { $remove = 'Remove'; $image = preg_match('/(^.*\.jpg|jpeg|png|gif|ico*)/i', $value); if ($image) { $output .= '' . $remove; } else { $parts = explode("/", $value); for ($i = 0; $i < sizeof($parts); ++$i) { $title = $parts[$i]; } $output .= ''; $title = __('View File', 'sparklestore'); $output .= ''; } } $output .= '
' . "\n"; echo $output; break; } } function sparklestore_widgets_updated_field_value($widget_field, $new_field_value) { extract($widget_field); if ($sparklestore_widgets_field_type == 'number') { return absint($new_field_value); } elseif ($sparklestore_widgets_field_type == 'textarea') { if (!isset($sparklestore_widgets_allowed_tags)) { $sparklestore_widgets_allowed_tags = '


'; } return strip_tags($new_field_value, $sparklestore_widgets_allowed_tags); } elseif ($sparklestore_widgets_field_type == 'url') { return esc_url_raw($new_field_value); } elseif ($sparklestore_widgets_field_type == 'title') { return wp_kses_post($new_field_value); } elseif ($sparklestore_widgets_field_type == 'multicheckboxes') { return wp_kses_post($new_field_value); } else { return strip_tags($new_field_value); } } /** * Load about section widget area file. */ require sparklestore_file_directory('sparklethemes/sparkle-widgets/sparkle-promo.php'); /** * Load promo video section widget area file. */ require sparklestore_file_directory('sparklethemes/sparkle-widgets/sparkle-promo-video.php'); /** * Load Full Promo widget area file. */ require sparklestore_file_directory('sparklethemes/sparkle-widgets/sparkle-fullpromo.php'); /** * Load Blogs Posts widget area file. */ require sparklestore_file_directory('sparklethemes/sparkle-widgets/sparkle-blogs-widget.php'); /** * Load contact form information widget area file. */ require sparklestore_file_directory('sparklethemes/sparkle-widgets/contact-info.php'); if (is_woocommerce_activated()) { /** * Load default tabs widget area file. */ require sparklestore_file_directory('sparklethemes/sparkle-widgets/tabs-defaults.php'); /** * Load products widget area file. */ require sparklestore_file_directory('sparklethemes/sparkle-widgets/sparkle-products-area.php'); /** * Load category product widget area file. */ require sparklestore_file_directory('sparklethemes/sparkle-widgets/sparkle-category-products.php'); /** * Load category collection widget area file. */ require sparklestore_file_directory('sparklethemes/sparkle-widgets/sparkle-category-collection.php'); /** * Load tabs category products widget area file. */ require sparklestore_file_directory('sparklethemes/sparkle-widgets/sparkle-tabs-category.php'); }