esc_html__('Our Services', 'ample-business'), 'sub-title' => '', 'resources' => '' ); return $defaults; } public function __construct() { parent::__construct( 'business_services_widget', esc_html__('AB : Services Widget', 'ample-business'), array('description' => esc_html__('Business Services Section', 'ample-business')) ); } public function form( $instance ) { $instance = wp_parse_args( (array ) $instance, $this->defaults() ); $title = esc_attr( $instance['title'] ); $subtitle = esc_attr( $instance['sub-title'] ); $resources = ( ! empty( $instance['resources'] ) ) ? $instance['resources'] : array(); ?>




= 1 && is_array( $resources ) ) { $selected = $resources['main']; } else { $selected = ""; } $repeater_id = $this->get_field_id( 'resources' ).'-main'; $repeater_name = $this->get_field_name( 'resources'). '[main]'; $args = array( 'selected' => $selected, 'name' => $repeater_name, 'id' => $repeater_id, 'class' => 'widefat pt-select', 'show_option_none' => __( 'Select Page', 'ample-business'), 'option_none_value' => 0 // string ); wp_dropdown_pages( $args ); ?> 0 ) { foreach( $resources as $resource ) { if ( isset( $resource['page_ids'] ) ) { ?>
get_field_id( 'resources' ) .'-'. $counter.'-page_ids'; $repeater_name = $this->get_field_name( 'resources' ) . '['.$counter.'][page_ids]'; $args = array( 'selected' => $resource['page_ids'], 'name' => $repeater_name, 'id' => $repeater_id, 'class' => 'widefat pt-select', 'show_option_none' => __( 'Select Page', 'ample-business'), 'option_none_value' => 0 // string ); wp_dropdown_pages( $args ); ?>

defaults()); $title = apply_filters('widget_title', !empty($instance['title']) ? esc_html($instance['title']) : '', $instance, $this->id_base); $subtitle = esc_html($instance['sub-title']); $resources = (!empty($instance['resources'])) ? $instance['resources'] : array(); echo $args['before_widget']; ?>

0 && is_array($resources)) { $post_in[0] = $resources['main']; foreach ($resources as $our_resource) { if (isset($our_resource['page_ids']) && !empty($our_resource['page_ids'])) { $post_in[] = $our_resource['page_ids']; } } } if (!empty($post_in)) : $resources_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' ); $resources_query = new WP_Query($resources_page_args); /*The Loop*/ if ($resources_query->have_posts()): $i = 1; while ($resources_query->have_posts()):$resources_query->the_post(); $icon = get_post_meta(get_the_ID(), 'ample_business_icon', true); $idvalue[] = get_the_ID(); ?>