'',
'title' => esc_html__('Our Services', 'business-uncode'),
);
return $defaults;
}
public function __construct()
{
parent::__construct(
'business-uncode-service-widget',
esc_html__('BU: Service Widget', 'business-uncode'),
array('description' => esc_html__('Business Service Section', 'business-uncode'))
);
}
public function form($instance)
{
$instance = wp_parse_args((array )$instance, $this->defaults());
$themesdivine_page_items = $instance['themesdivine_page_items'];
$title = esc_attr($instance['title']);
?>
get_field_id('themesdivine_page_items') . $total_repeater . 'page_id';
$repeater_name = $this->get_field_name('themesdivine_page_items') . '[' . $total_repeater . '][' . 'page_id' . ']';
?>
$about['page_id'],
'name' => $repeater_name,
'id' => $repeater_id,
'class' => 'widefat themesdivine-select',
'show_option_none' => __('Select Page', 'business-uncode'),
'option_none_value' => 0 // string
);
wp_dropdown_pages($args);
?>
get_field_id('themesdivine_page_items') . $structure_repeater_depth . 'page_id';
$repeater_name = $this->get_field_name('themesdivine_page_items') . '[' . $structure_repeater_depth . '][' . 'page_id' . ']';
?>
';
$add_field = __('Add Item', 'business-uncode');
echo '
' . $add_field . '';
?>
0 && is_array($themesdivine_page_items)) {
foreach ($themesdivine_page_items as $key => $about) {
$page_ids[$key]['page_id'] = absint($about['page_id']);
}
}
}
$instance['themesdivine_page_items'] = $page_ids;
return $instance;
}
public function widget($args, $instance)
{
if (!empty($instance)) {
$instance = wp_parse_args((array )$instance, $this->defaults());
$themesdivine_page_items = $instance['themesdivine_page_items'];
$title = apply_filters('widget_title', !empty($instance['title']) ? esc_html($instance['title']) : '', $instance, $this->id_base);
echo $args['before_widget'];
?>
0 && is_array($themesdivine_page_items)) {
foreach ($themesdivine_page_items as $our_service) {
if (isset($our_service['page_id']) && !empty($our_service['page_id'])) {
$post_in[] = $our_service['page_id'];
}
}
}
if (!empty($post_in)) :
$our_service_page_args = array(
'post__in' => $post_in,
'orderby' => 'post__in',
'posts_per_page' => count($post_in),
'post_type' => 'page',
'no_found_rows' => true,
'post_status' => 'publish'
);
$our_service_query = new WP_Query($our_service_page_args);
/*The Loop*/
if ($our_service_query->have_posts()):
$i = 1;
while ($our_service_query->have_posts()):$our_service_query->the_post();
$icon = get_post_meta(get_the_ID(), 'business_uncode_icon', true);
$idvalue[] = get_the_ID();
?>