0, 'label' => esc_html__('Select Categories','sparklestore') ); $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; /** * Default Page List in array */ $sparklestore_pagelist[0] = array( 'value' => 0, 'label' => esc_html__('Select Pages','sparklestore') ); $arg = array( 'posts_per_page' => -1 ); $sparklestore_pages = get_pages( $arg ); foreach ( $sparklestore_pages as $sparklestore_page ) : $sparklestore_pagelist[$sparklestore_page->ID] = array( 'value' => $sparklestore_page->ID, 'label' => $sparklestore_page->post_title ); 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)) { ?> '; $image_class = ' hidden'; } ?>


'; foreach ( $sparklestore_widgets_field_options as $option => $val ){ $class = ( $sparklestore_field_value == $option ) ? 'selector-selected': ''; echo ''; } echo ''; echo ''; 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 wp_kses_post($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 $new_field_value; } else { return wp_kses_post($new_field_value); } } /** * Load about section widget area file. */ require get_template_directory().'/sparklethemes/sparkle-widgets/sparkle-promo.php'; require get_template_directory().'/sparklethemes/sparkle-widgets/sparkle-newpromo.php'; /** * Load Full Promo widget area file. */ require get_template_directory().'/sparklethemes/sparkle-widgets/sparkle-fullpromo.php'; /** * Load Blogs Posts widget area file. */ require get_template_directory().'/sparklethemes/sparkle-widgets/sparkle-blogs-widget.php'; if (sparklestore_is_woocommerce_activated()) { /** * Load products widget area file. */ require get_template_directory().'/sparklethemes/sparkle-widgets/sparkle-products-area.php'; /** * Load category product widget area file. */ require get_template_directory().'/sparklethemes/sparkle-widgets/sparkle-category-products.php'; /** * Load category collection widget area file. */ require get_template_directory().'/sparklethemes/sparkle-widgets/sparkle-category-collection.php'; /** * Load tabs category products widget area file. */ require get_template_directory().'/sparklethemes/sparkle-widgets/sparkle-tabs-category.php'; }