'', 'sub_title' => '', 'features' =>'', ); return $defaults; } function __construct() { parent::__construct( /*Base ID of your widget*/ 'nexas_our_team_widget', /*Widget name will appear in UI*/ __( 'Nexas Team Section', 'nexas' ), /*Widget description*/ array( 'description' => __( 'Nexas Our Team Section With Repeater.', 'nexas' ), ) ); } /** * Function to Creating widget front-end. This is where the action happens * * @access public * @since 1.0 * * @param array $args widget setting * @param array $instance saved values * * @return void * */ public function widget( $args, $instance ) { if (!empty( $instance ) ) { $instance = wp_parse_args( (array ) $instance, $this->defaults ()); $title = apply_filters( 'widget_title', ! empty( $instance['title'] ) ? $instance['title'] : '', $instance, $this->id_base ); $sub_title = apply_filters( 'widget_title', ! empty( $instance['sub_title'] ) ? $instance['sub_title'] : '', $instance, $this->id_base ); $features = ( ! empty( $instance['features'] ) ) ? $instance['features'] : array(); echo $args['before_widget']; ?>


0 && is_array($features) ){ $post_in[0] = $features['main']; foreach ( $features as $our_team ){ if( isset( $our_team['page_ids'] ) && !empty( $our_team['page_ids'] ) ){ $post_in[] = $our_team['page_ids']; } } } if( !empty( $post_in )) : $our_team_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_team_query = new WP_Query( $our_team_page_args ); /*The Loop*/ if ( $our_team_query->have_posts() ): $i = 0.1; while ( $our_team_query->have_posts() ):$our_team_query->the_post(); ?>
" data-wow-delay="s">

defaults() ); $title = esc_attr( $instance['title'] ); $sub_title = esc_attr( $instance['sub_title'] ); $features = ( ! empty( $instance['features'] ) ) ? $instance['features'] : array(); ?>


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