0, 'label' => esc_html__('Select Categories','metrostore') ); $metrostore_posts = get_categories(); foreach ($metrostore_posts as $metrostore_post) : $metrostore_category_list[$metrostore_post->term_id] = array( 'value' => $metrostore_post->term_id, 'label' => $metrostore_post->name ); endforeach; /** * Default Page List in array */ $metrostore_pagelist[0] = array( 'value' => 0, 'label' => esc_html__('Select Pages','metrostore') ); $arg = array('posts_per_page' => -1); $metrostore_pages = get_pages($arg); foreach ($metrostore_pages as $metrostore_page) : $metrostore_pagelist[$metrostore_page->ID] = array( 'value' => $metrostore_page->ID, 'label' => $metrostore_page->post_title ); endforeach; extract($widget_field); switch ($metrostore_widgets_field_type) { /** * Standard text field area **/ case 'text' : ?>




/>

'; foreach ($metrostore_widgets_field_options as $metrostore_option_name => $metrostore_option_title) { ?> />






'; foreach ( $metrostore_widgets_field_options as $metrostore_option_name => $metrostore_option_title) { if( isset( $metrostore_field_value[$metrostore_option_name] ) ) { $metrostore_field_value[$metrostore_option_name] = 1; }else{ $metrostore_field_value[$metrostore_option_name] = 0; } ?>

/>

'; if (isset($metrostore_widgets_description)) { ?> get_field_id($metrostore_widgets_name); $class = ''; $int = ''; $value = $metrostore_field_value; $name = $instance->get_field_name($metrostore_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 .= '

' . esc_html__('Upgrade your version of WordPress for full media support.', 'metrostore') . '

'; } $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 = esc_html__('View File', 'metrostore'); $output .= ''; } } $output .= '
' . "\n"; echo $output; break; } } function metrostore_widgets_updated_field_value($widget_field, $new_field_value) { extract($widget_field); if ($metrostore_widgets_field_type == 'number') { return absint($new_field_value); } elseif ($metrostore_widgets_field_type == 'textarea') { if (!isset($metrostore_widgets_allowed_tags)) { $metrostore_widgets_allowed_tags = '

'; } return wp_kses_data($new_field_value, $metrostore_widgets_allowed_tags); } elseif ($metrostore_widgets_field_type == 'url') { return esc_url_raw($new_field_value); } elseif ($metrostore_widgets_field_type == 'title') { return wp_kses_post($new_field_value); } elseif ($metrostore_widgets_field_type == 'multicheckcategory') { return wp_kses_post($new_field_value); } else { return wp_kses_data($new_field_value); } } if( metrostore_is_woocommerce_activated() ){ /** * Load category collection widget area file. */ require metrostore_file_directory('sparklethemes/sparkle-widgets/category-collection.php'); /** * Load tabs category products widget area file. */ require metrostore_file_directory('sparklethemes/sparkle-widgets/tabs-category.php'); /** * Load default tabs widget area file. */ require metrostore_file_directory('sparklethemes/sparkle-widgets/tabs-defaults.php'); /** * Load products widget area file. */ require metrostore_file_directory('sparklethemes/sparkle-widgets/products-area.php'); } /** * Load Blogs Posts widget area file. */ require metrostore_file_directory('sparklethemes/sparkle-widgets/blogs-widget.php'); /** * Load Promo Video widget area file. */ require metrostore_file_directory('sparklethemes/sparkle-widgets/promo-video.php'); /** * Load quick contact information widget area file. */ require metrostore_file_directory('sparklethemes/sparkle-widgets/quick-contact-info.php'); /** * Load contact form information widget area file. */ require metrostore_file_directory('sparklethemes/sparkle-widgets/contact-form-info.php'); /** * Load about section widget area file. */ require metrostore_file_directory('sparklethemes/sparkle-widgets/about-section.php'); /** * Load skills section widget area file. */ require metrostore_file_directory('sparklethemes/sparkle-widgets/skills-section.php');