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) {
?>
/>
/>
'; 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 = '