} else { $author_role = get_option('blogname'); } } $specifications = get_post_meta(get_the_ID(), 'feat_data', true); $new_highlighted_specs = imic_filter_lang_specs_admin($highlighted_specs, get_the_ID()); $highlighted_specs = $new_highlighted_specs; $unique_value = imic_vehicle_price(get_the_ID(), $unique_specs, $specifications); $highlight_value = imic_vehicle_title(get_the_ID(), $highlighted_specs, $specifications); $details_value = imic_vehicle_all_specs(get_the_ID(), $detailed_specs, $specifications); if (!empty($additional_specs)) { if ($imic_options['specification_fields_type'] == "0") { $image_key = array_search($additional_specs, $specifications['sch_title']); $additional_specs_value = $specifications['start_time'][$image_key]; } else { $img_char = imic_the_slug($additional_specs); $additional_specs_value = get_post_meta(get_the_ID(), 'char_' . $img_char, true); } $this_key = find_car_with_position($additional_specs_all, $additional_specs_value); $img_src = $additional_specs_all[$this_key]['imic_plugin_spec_image']; } $badges = imic_vehicle_all_specs(get_the_ID(), $badge_ids, $specifications); ?> <li class="item"> <div class="vehicle-block format-standard"> <?php if (has_post_thumbnail()) { ?> <a href="<?php echo esc_url(get_permalink()); ?>
if ($int == 0) { $spec_slug = imic_the_slug($field); } elseif ($int == 1) { if ($numeric_specs_type == 0) { $spec_slug = "int_" . imic_the_slug($field); } else { $spec_slug = "range_" . imic_the_slug($field); $min_val = get_post_meta($field, 'imic_plugin_range_min_value', true); $max_val = get_post_meta($field, 'imic_plugin_range_max_value', true); $steps = get_post_meta($field, 'imic_plugin_range_steps', true); $min_val = $min_val != '' ? $min_val : 0; $max_val = $max_val != '' ? $max_val : 100000; $steps = $steps != '' ? $steps : 1000; } } elseif ($int == 2) { $spec_slug = "char_" . imic_the_slug($field); } $get_child = imic_get_child_values_status($specs) == 1 ? 'get-child-field' : ''; echo '<div class="col-md-3 col-sm-3">'; if ($int == 1) { ?> <b><?php echo esc_attr(get_the_title($field)); echo ' ' . $value_label; ?> <input class="search-range" type="hidden" name="<?php echo esc_attr($spec_slug); ?> " value=""><span class="left"><?php echo esc_attr($min_val); ?>
function widget($args, $instance) { extract($args); // these are the widget options $post_title = apply_filters('widget_title', $instance['title']); $post_title = $post_title == '' ? __('Latest Added', 'imic-framework-admin') : $post_title; $category = apply_filters('widget-category', empty($instance['category']) ? '' : $instance['category'], $instance, $this->id_base); $number = apply_filters('widget-number', $instance['number']); echo $args['before_widget']; global $imic_options; if (!empty($instance['title'])) { echo $args['before_title']; echo apply_filters('widget_title', $post_title, $instance, $this->id_base); echo $args['after_title']; } if (isset($imic_options['enable_rtl']) && $imic_options['enable_rtl'] == 1) { $DIR = 'data-rtl="rtl"'; } else { $DIR = 'data-rtl="ltr"'; } echo ' <div class="carousel-wrapper"> <div class="row"> <ul class="owl-carousel single-carousel" id="vehicle-slider" data-columns="1" data-autoplay="" data-pagination="no" data-arrows="no" data-single-item="no" data-items-desktop="1" data-items-desktop-small="1" data-items-tablet="2" data-items-mobile="1" ' . $DIR . '>'; $badges_type = isset($imic_options['badges_type']) ? $imic_options['badges_type'] : '0'; $specification_type = isset($imic_options['short_specifications']) ? $imic_options['short_specifications'] : '0'; if ($badges_type == "0") { $badge_ids = $imic_options['badge_specs']; } else { $badge_ids = array(); } $img_src = ''; if ($specification_type == 0) { $detailed_specs = isset($imic_options['specification_list']) ? $imic_options['specification_list'] : array(); } else { $detailed_specs = array(); } $additional_specs = isset($imic_options['additional_specs']) ? $imic_options['additional_specs'] : ''; //$detailed_specs = $imic_options['vehicle_specs']; $additional_specs_all = get_post_meta($additional_specs, 'specifications_value', true); $highlighted_specs = isset($imic_options['highlighted_specs']) ? $imic_options['highlighted_specs'] : ''; $unique_specs = $imic_options['unique_specs']; $listing_page_url = imic_get_template_url('template-listing.php'); $args_cars = array('post_type' => 'cars', 'posts_per_page' => $number, 'post_status' => 'publish', 'meta_query' => array(array('key' => 'imic_plugin_ad_payment_status', 'value' => $category, 'compare' => '='))); $cars_listing = new WP_Query($args_cars); if ($cars_listing->have_posts()) { while ($cars_listing->have_posts()) { $cars_listing->the_post(); if (is_plugin_active("imi-classifieds/imi-classified.php")) { $badge_ids = imic_classified_badge_specs(get_the_ID(), $badge_ids); $detailed_specs = imic_classified_short_specs(get_the_ID(), $detailed_specs); } $post_author_id = get_post_field('post_author', get_the_ID()); $user_info_id = get_user_meta($post_author_id, 'imic_user_info_id', true); $author_role = get_option('blogname'); if (!empty($user_info_id)) { $term_list = wp_get_post_terms($user_info_id, 'user-role', array("fields" => "names")); if (!empty($term_list)) { $author_role = $term_list[0]; } else { $author_role = get_option('blogname'); } } $specifications = get_post_meta(get_the_ID(), 'feat_data', true); $unique_value = imic_vehicle_price(get_the_ID(), $unique_specs, $specifications); $new_highlighted_specs = imic_filter_lang_specs_admin($highlighted_specs, get_the_ID()); $highlighted_specs = $new_highlighted_specs; $highlight_value = imic_vehicle_title(get_the_ID(), $highlighted_specs, $specifications); $highlight_value = $highlight_value != '' ? $highlight_value : get_the_title(); $details_value = imic_vehicle_all_specs(get_the_ID(), $detailed_specs, $specifications); if (!empty($additional_specs)) { if ($imic_options['specification_fields_type'] == "0") { $image_key = array_search($additional_specs, $specifications['sch_title']); $additional_specs_value = $specifications['start_time'][$image_key]; } else { $img_char = imic_the_slug($additional_specs); $additional_specs_value = get_post_meta(get_the_ID(), 'char_' . $img_char, true); } $this_key = find_car_with_position($additional_specs_all, $additional_specs_value); $img_src = $additional_specs_all[$this_key]['imic_plugin_spec_image']; } ?> <li class="item"> <div class="vehicle-block format-standard"> <?php if (has_post_thumbnail()) { if ($category == 1) { ?> <a href="<?php echo esc_url(get_permalink()); ?> " class="media-box"><?php the_post_thumbnail('600x400'); ?> </a><?php } else { ?> <a href="javascript:void(0);" class="media-box"><?php the_post_thumbnail('600x400'); ?> </a><?php } } ?> <div class="vehicle-block-content"> <?php if ($category == 1) { ?> <h5 class="vehicle-title"><a href="<?php echo esc_url(get_permalink()); ?> "><?php echo esc_attr($highlight_value); ?> </a></h5><?php } else { ?> <h5 class="vehicle-title"><?php echo esc_attr($highlight_value); ?> </h5><?php } ?> <span class="vehicle-meta"><?php if (!empty($details_value)) { foreach ($details_value as $value) { echo esc_attr($value) . ', '; } } echo esc_attr_e(' by ', 'framework'); ?> <abbr class="user-type" title="<?php echo esc_attr_e('Listed by', 'framework'); echo esc_attr($author_role); ?> "><?php echo esc_attr($author_role); ?> </abbr></span> <?php if ($img_src != '') { ?> <a href="<?php echo esc_url($listing_page_url); ?> " title="<?php echo esc_attr_e('View all ', 'framework'); echo esc_attr($additional_specs_all[$this_key]['imic_plugin_specification_values']); ?> " class="vehicle-body-type"><img src="<?php echo esc_url($additional_specs_all[$this_key]['imic_plugin_spec_image']); ?> " alt=""></a><?php } ?> <span class="vehicle-cost"><?php echo esc_attr($unique_value); ?> </span> </div> </div> </li> <?php } } wp_reset_postdata(); echo '</ul> </div> </div>'; echo $args['after_widget']; }
<?php if ($make_search_switch == 1) { if (is_plugin_active("imithemes-listing/listing.php")) { $specification_scroll = get_post_meta($id, 'imic_home_search_specification_auto_scroll', true); $specification_vehicle_scroll_speed = get_post_meta($id, 'imic_home_search_specification_auto_scroll_speed', true); $specification_vehicle_scroll_speed = $specification_vehicle_scroll_speed == '' ? 5000 : $specification_vehicle_scroll_speed; $specification_speed = $specification_scroll == 1 ? $specification_vehicle_scroll_speed : ''; $search_by_spec_value = get_post_meta(get_the_ID(), 'imic_search_by_specification', true); $title = get_post_meta(get_the_ID(), 'imic_search_by_specification_title', true); $url = get_post_meta(get_the_ID(), 'imic_search_by_specification_url', true); $search_listing = imic_get_template_url("template-listing.php"); $spec_int = get_post_meta($search_by_spec_value, 'imic_plugin_spec_char_type', true); if ($spec_int == 0) { $slug = imic_the_slug($search_by_spec_value); } else { $slug = "int_" . imic_the_slug($search_by_spec_value); } if (!empty($search_by_spec_value)) { ?> <div class="lgray-bg make-slider"> <div class="container"> <!-- Search by make --> <div class="row"> <div class="col-md-3 col-sm-4"> <h3><?php echo esc_attr($title); ?> </h3> <a href="<?php echo esc_url($url); ?>
function imic_vehicle_compare_specs($id, $specs, $this_specification) { $details_value = array(); if (!empty($specs)) { $details_value = array(); foreach ($specs as $details) { $val = ''; $int_type = get_post_meta($details, 'imic_plugin_spec_char_type', true); $value_label = get_post_meta($details, 'imic_plugin_value_label', true); $label_position = get_post_meta($details, 'imic_plugin_lable_position', true); $detailed_spec_key = array_search($details, $this_specification['sch_title']) ? array_search($details, $this_specification['sch_title']) : ''; $second_key = array_search($details * 111, $this_specification['sch_title']) ? array_search($details * 111, $this_specification['sch_title']) : ''; if ($int_type == 1) { $slug = imic_the_slug($details); if ($label_position == 0) { $details_value[] = $value_label . get_post_meta($id, 'int_' . $slug, true); } else { $details_value[] = get_post_meta($id, 'int_' . $slug, true) . $value_label; } } elseif ($int_type == 2) { $slug = imic_the_slug($details); if ($label_position == 0) { $details_value[] = $value_label . get_post_meta($id, 'char_' . $slug, true); } else { $details_value[] = get_post_meta($id, 'char_' . $slug, true) . $value_label; } } else { if (is_int($second_key) && $second_key != '') { $val = ' ' . $this_specification['start_time'][$second_key]; } else { $val = ''; } if ($label_position == 0) { if ($detailed_spec_key != '') { $cur_spec = $this_specification['start_time'][$detailed_spec_key]; } else { $cur_spec = ''; } if ($cur_spec != '') { $spec = $cur_spec; } else { $spec = ''; } $details_value[] = $value_label . $spec . $val; } else { $details_value[] = $spec . $val . $value_label; } } } } return $details_value; }
<!-- Utiity Bar --> <div class="utility-bar"> <div class="container"> <div class="row"> <div class="col-md-4 col-sm-6"> <?php if (!empty($spec_browse)) { $specification_img = get_post_meta($spec_browse, 'specifications_value', true); $browse_title = get_post_meta($id, 'imic_browse_by_specification_title', true); $spec_int = get_post_meta($spec_browse, 'imic_plugin_spec_char_type', true); if ($spec_int == 0) { $slug = imic_the_slug($spec_browse); } elseif ($spec_int == 1) { $slug = "int_" . imic_the_slug($spec_browse); } else { $slug = "char_" . imic_the_slug($spec_browse); } ?> <div class="toggle-make"> <a href="#"><i class="fa fa-navicon"></i></a> <span><?php echo esc_attr($browse_title); ?> </span> </div><?php } ?> </div> <div class="col-md-8 col-sm-6"> <?php imic_share_buttons();
function imic_browse_listing($atts, $content = null) { extract(shortcode_atts(array("title" => "", "value" => "", "specs" => ""), $atts)); $output = ''; if (is_plugin_active("imithemes-listing/listing.php")) { $browse_listing = imic_get_template_url("template-listing.php"); if (!empty($specs)) { $specification_img = get_post_meta($specs, 'specifications_value', true); $spec_int = get_post_meta($specs, 'imic_plugin_spec_char_type', true); if ($spec_int == 0) { $slug = imic_the_slug($specs); } else { $slug = "int_" . imic_the_slug($specs); } $output .= '<ul class="body-type-widget">'; foreach ($specification_img as $img) { $speci_value = $img['imic_plugin_specification_values']; $speci_value = str_replace(' ', '%20', $speci_value); $output .= '<li> <a href="' . esc_url(add_query_arg($slug, $speci_value, $browse_listing)) . '">'; if ($img['imic_plugin_spec_image'] != '') { $output .= '<img src="' . $img['imic_plugin_spec_image'] . '" alt="">'; } if ($value == 1) { $output .= '<span>' . $img['imic_plugin_specification_values'] . '</span></a></li>'; } else { $output .= '</a></li>'; } } $output .= '</ul> <a href="' . $browse_listing . '" class="basic-link">' . __('view all', 'framework') . '</a>'; } } return $output; }
/** * Save post action, process fields */ function imic_update_event_fields_data($post_id, $post_object) { if (!isset($_POST['event_schedule_meta_box_nonce'])) { return; } // Verify that the nonce is valid. if (!wp_verify_nonce($_POST['event_schedule_meta_box_nonce'], 'event_schedule_meta_box')) { return; } // Doing revision, exit earlier **can be removed** if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return; } // Doing revision, exit earlier if ('revision' == $post_object->post_type) { return; } // Verify authenticity // Check the user's permissions. if (isset($_POST['post_type']) && 'yachts' == $_POST['post_type']) { if (!current_user_can('edit_page', $post_id)) { return; } } else { if (!current_user_can('edit_post', $post_id)) { return; } } /* OK, it's safe for us to save the data now. */ $args_specification = array('post_type' => 'specification', 'posts_per_page' => -1, 'post_status' => 'publish', 'meta_query' => array(array('key' => 'imic_plugin_spec_char_type', 'value' => "0", 'compare' => "!="))); $specification_listing = new WP_Query($args_specification); if ($specification_listing->have_posts()) { while ($specification_listing->have_posts()) { $specification_listing->the_post(); $specs_slug = imic_the_slug(get_the_ID()); $field_type = get_post_meta(get_the_ID(), 'imic_plugin_spec_char_type', true); if ($field_type == "1" && isset($_POST['int_' . $specs_slug])) { update_post_meta($post_id, 'int_' . $specs_slug, $_POST['int_' . $specs_slug]); } elseif ($field_type == "2" && isset($_POST['char_' . $specs_slug])) { update_post_meta($post_id, 'char_' . $specs_slug, $_POST['char_' . $specs_slug]); if (isset($_POST['child_' . $specs_slug])) { update_post_meta($post_id, 'child_' . $specs_slug, $_POST['child_' . $specs_slug]); } } } } wp_reset_postdata(); if ($_POST['featured']) { // Build array for saving post meta $feat_data = array(); for ($i = 0; $i < count($_POST['featured']['sch_title']); $i++) { if ('' != $_POST['featured']['sch_title'][$i]) { $feat_data['start_time'][] = $_POST['featured']['start_time'][$i]; $feat_data['sch_title'][] = $_POST['featured']['sch_title'][$i]; } } if ($feat_data) { update_post_meta($post_id, 'feat_data', $feat_data); } else { delete_post_meta($post_id, 'feat_data'); } } else { delete_post_meta($post_id, 'feat_data'); } }
function imic_set_ad_fields() { //echo "saibaba"; global $imic_options; $custom_details = array(); $category_slug = $_POST['slug']; $update_id = $_POST['update']; $required_value = ''; $specifications = get_post_meta($update_id, 'feat_data', true); $term_id = get_term_by('slug', $category_slug, 'listing-category'); $parents = get_ancestors($term_id->term_id, 'listing-category'); $term_id = $term_id->term_id; $classifieds_details = get_option('imic_classifieds'); $classifieds_details = !empty($classifieds_details) ? get_option('imic_classifieds') : array(); if (array_key_exists($term_id, $classifieds_details) && !empty($classifieds_details)) { $custom_details = $classifieds_details[$term_id]['ad']; $custom_details = explode(',', $custom_details); } else { foreach ($parents as $parent) { $list_term = get_term_by('id', $parent, 'listing-category'); if (array_key_exists($list_term->term_id, $classifieds_details) && !empty($classifieds_details)) { $custom_details = $classifieds_details[$list_term->term_id]['ad']; $custom_details = explode(',', $custom_details); break; } } } if (empty($custom_details) && $imic_options['ad_listing_fields'] != 1) { $custom_details = $imic_options['custom_vehicle_details']; } $total_fields = count($custom_details); $half = $total_fields / 2; $half = imic_is_decimal($half) ? $half + 1 : $half; $half = floor($half); if (!empty($custom_details) && $imic_options['ad_listing_fields'] == 1) { echo "<div class=\"row\">"; $st = 1; foreach ($custom_details as $field) { $label = get_post_meta($field, 'imic_plugin_value_label', true); $editable = get_post_meta($field, 'imic_plugin_status_after_payment', true); $disable = $editable == 0 && $payment_status != 0 ? 'disabled' : ''; if ($st == 1 || $st == $half + 1) { echo '<div class="col-md-6">'; } $values = get_post_meta($field, 'specifications_value', true); $post_data = get_post($field); $spec_slug = $post_data->post_name; $required = get_post_meta($field, 'imic_plugin_required_mandatory', true); $integer = get_post_meta($field, 'imic_plugin_spec_char_type', true); $sub_fields = get_post_meta($field, 'imic_plugin_sub_field_switch', true); $sortable_class = $sub_fields == 1 ? "sortable-specs" : ""; if ($integer == 0) { $input_id = 'field-' . ($field + 2648); } elseif ($integer == 2) { $input_id = 'char-' . ($field + 2648); } else { $input_id = 'int-' . $field; } $required = $required == 1 ? 'mandatory' : ''; $int_value = $integer == 1 ? 'integer-val' : ''; echo '<label>' . __('Select ', 'framework') . get_the_title($field) . '</label>'; if (count($values) > 1 && ($integer == 0 || $integer == 2)) { echo '<select ' . $disable . ' name="' . basename(get_permalink($field)) . '" id="' . $input_id . '" class="' . $sortable_class . ' form-control selectpicker custom-cars-fields ' . $required . '">'; echo '<option value="0">' . __('Select', 'framework') . '</option>'; if ($update_id != '') { if ($integer == 0) { $key = array_search($field, $specifications['sch_title']); $required_value = $specifications['start_time'][$key]; } elseif ($integer == 2) { $required_value = get_post_meta($update_id, 'char_' . $spec_slug, true); } else { $required_value = get_post_meta($update_id, 'int_' . $spec_slug, true); } } $key_select = $count = 0; foreach ($values as $value) { $required_select = $required_value == $value['imic_plugin_specification_values'] ? 'selected' : ''; if ($required_select != '') { $key_select = $count; } echo '<option ' . esc_attr($required_select) . ' value="' . $value['imic_plugin_specification_values'] . '">' . $value['imic_plugin_specification_values'] . '</option>'; $count++; } echo '</select>'; if ($sub_fields == 1 && $integer == 0 || $sub_fields == 1 && $integer == 2) { $child_field_class = $integer == 0 ? "field-" : "char-"; $child_field_class_select = $integer == 0 ? "field-" : "child-"; echo '<div class="' . $child_field_class . ($field * 111 + 2648) . ' sorting-dynamic">'; if (!empty($values[$key_select]['imic_plugin_specification_values_child'])) { echo '<label>' . __('Select ', 'framework') . get_post_meta($field, 'imic_plugin_sub_field_label', true) . '</label>'; echo '<select ' . $disable . ' id="' . $child_field_class_select . ($field * 111 + 2648) . '" name="' . $field * 111 . '" class="form-control selectpicker custom-cars-fields">'; echo '<option value="0">' . __('Select ', 'framework') . get_the_title($field) . '</option>'; if ($update_id != '') { if ($specification_data_type == "0") { $key = array_search($field * 111, $specifications['sch_title']); $required_value = $specifications['start_time'][$key]; } else { $child_field_slug = imic_the_slug($field); $required_value = get_post_meta($update_id, 'child_' . $child_field_slug, true); } $child_vals = $values[$key_select]['imic_plugin_specification_values_child']; if (!empty($child_vals)) { $child_values = explode(',', $child_vals); } foreach ($child_values as $value) { $required_select = $required_value == $value ? 'selected' : ''; echo '<option ' . $required_select . ' value="' . $value . '">' . $value . '</option>'; } } echo '</select>'; } echo '</div>'; } } else { if ($update_id != '') { $required_value = ''; if ($integer == 0) { $key = array_search($field, $specifications['sch_title']); $required_value = $specifications['start_time'][$key]; } elseif ($integer == 2) { $required_value = get_post_meta($update_id, 'char_' . $spec_slug, true); } else { $required_value = get_post_meta($update_id, 'int_' . $spec_slug, true); } } if ($label != '') { echo '<div class="input-group"> <input ' . $disable . ' type="text" id="' . $input_id . '" value="' . $required_value . '" name="' . basename(get_permalink($field)) . '" class="form-control custom-cars-fields ' . $required . ' ' . $int_value . '" placeholder="' . get_the_title($field) . '"> <span class="input-group-addon">' . $label . '</span></div>'; } else { echo '<input ' . $disable . ' type="text" id="' . $input_id . '" value="' . $required_value . '" name="' . basename(get_permalink($field)) . '" class="form-control custom-cars-fields ' . $required . ' ' . $int_value . '" placeholder="' . get_the_title($field) . '">'; } } if ($st == $half || count($custom_details) == $st) { echo '</div>'; } $st++; } //echo "</div>"; if (is_user_logged_in()) { ?> <button id="ss" class="btn btn-info pull-right save-searched-value"><?php echo esc_attr_e('Save', 'framework'); ?> & <?php echo esc_attr_e('continue', 'framework'); ?> </button><?php } else { echo '<a class="btn btn-primary pull-right" data-toggle="modal" data-target="#PaymentModal">' . __('Login/Register', 'framework') . '</a>'; } } else { echo "blank"; } die; }
?> --> <?php $new_search_filters = imic_filter_lang_specs($search_filters); $specifications = get_post_meta(get_the_ID(), 'feat_data', true); $details_value = imic_vehicle_all_specs(get_the_ID(), $detailed_specs, $specifications); $badges = imic_vehicle_all_specs(get_the_ID(), $badge_ids, $specifications); //$details_value = imic_vehicle_all_specs(get_the_ID(),$detailed_specs,$specifications); //$badges = imic_vehicle_all_specs(get_the_ID(),$badge_ids,$specifications); $specification_data_type = isset($imic_options['specification_fields_type']) ? $imic_options['specification_fields_type'] : "0"; foreach ($new_search_filters as $featured) { $field_type = get_post_meta($featured, 'imic_plugin_spec_char_type', true); $value_label = get_post_meta($featured, 'imic_plugin_value_label', true); $label_position = get_post_meta($featured, 'imic_plugin_lable_position', true); $badge_slug = imic_the_slug($featured); $this_specification = get_post_meta(get_the_ID(), 'feat_data', true); if ($specification_data_type == "0") { $spec_key = array_search($featured, $this_specification['sch_title']); $second_key = array_search($featured * 111, $this_specification['sch_title']); } else { $spec_key = $second_key = ''; } $id = get_the_ID(); $feat_val = get_post_meta($id, 'int_' . $badge_slug, true); if (get_the_title($featured) == 'Size' || get_the_title($featured) == 'Type' || get_the_title($featured) == 'Brand' || get_the_title($featured) == 'Builder Year' || get_the_title($featured) == 'Location' || get_the_title($featured) == 'Price') { if ($field_type == 1 && $feat_val != '') { if ($label_position == 0) { echo '<li id="' . get_the_title($featured) . '"> <span class="new-badge">' . get_the_title($featured) . '</span> ' . $value_label . get_post_meta($id, 'int_' . $badge_slug, true) . '</li>'; } else { echo '<li id="' . get_the_title($featured) . '"> <span class="new-badge">' . get_the_title($featured) . '</span> ' . get_post_meta($id, 'int_' . $badge_slug, true) . $value_label . '</li>';
function imic_list_child_specs() { $spec_id = isset($_POST['specid']) ? $_POST['specid'] : ''; $spec_val = isset($_POST['parent']) ? $_POST['parent'] : ''; $list_id = isset($_POST['listid']) ? $_POST['listid'] : ''; if ($spec_id != '' && $spec_val != '') { $char_slug = imic_the_slug($spec_id); $spec_value = ''; $current_value = get_post_meta($list_id, 'child_' . $char_slug, true); $values = get_post_meta($spec_id, 'specifications_value', true); echo '<select type="text" class="meta_feat_title rwmb-select" name="child_' . esc_attr($char_slug) . '">'; foreach ($values as $value) { if ($spec_val == $value['imic_plugin_specification_values']) { $child_vals = $value['imic_plugin_specification_values_child']; $child_vals = explode(',', $child_vals); break; } } foreach ($child_vals as $val) { $selected = $current_value == $val || $current_value == " " . $val ? 'selected' : ''; echo '<option ' . $selected . ' value="' . $val . '">' . $val . '</option>'; } echo '</select>'; } die; }
} echo '</select>'; if ($sub_fields == 1 && ($integer == 0 || $integer == 2)) { $child_field_class = $integer == 0 ? "field-" : "char-"; $child_field_class_select = $integer == 0 ? "field-" : "child-"; echo '<div class="' . $child_field_class . ($field * 111 + 2648) . ' sorting-dynamic">'; if (!empty($values[$key_select]['imic_plugin_specification_values_child'])) { echo '<label>' . __('Select ', 'framework') . get_post_meta($field, 'imic_plugin_sub_field_label', true) . '</label>'; echo '<select ' . $disable . ' id="' . $child_field_class_select . ($field * 111 + 2648) . '" name="' . $field * 111 . '" class="form-control selectpicker custom-cars-fields">'; echo '<option value="0">' . __('Select ', 'framework') . get_the_title($field) . '</option>'; if ($update_id != '') { if ($specification_data_type == "0") { $key = array_search($field * 111, $specifications['sch_title']); $required_value = $specifications['start_time'][$key]; } else { $child_field_slug = imic_the_slug($field); $required_value = get_post_meta($field, 'char_' . $child_field_slug, true); } $child_vals = $values[$key_select]['imic_plugin_specification_values_child']; //print_r($child_vals); if (!empty($child_vals)) { $child_values = explode(',', $child_vals); } //print_r($child_values); foreach ($child_values as $value) { $required_select = $required_value == $value ? 'selected' : ''; echo '<option ' . $required_select . ' value="' . $value . '">' . $value . '</option>'; } } echo '</select>'; }