esc_html__('CORE FEATURES', 'nexas'), 'features_background' => '', 'features' => '' ); return $defaults; } public function __construct() { parent::__construct( /*Widget ID*/ 'nexas_feature_widget', /*Widget name*/ esc_html__('Nexas Feature Widget', 'nexas'), /*Widget Description*/ array('description' => esc_html__('Nexas Feature Section', '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() ); /*default values*/ $features_title = apply_filters( 'widget_title', !empty( $instance['features_title'] ) ? esc_html( $instance['features_title'] ) : '', $instance, $this->id_base); $features_background = esc_url($instance['features_background']); $features = ( ! empty( $instance['features'] ) ) ? $instance['features'] : array(); echo $args['before_widget']; ?>

0 && is_array($features) ) { $post_in[0] = $features['main']; foreach ( $features as $our_feature ) { if( isset( $our_feature['page_ids'] ) && !empty( $our_feature['page_ids'] ) ) { $post_in[] = $our_feature['page_ids']; } } } if( !empty( $post_in )) : $features_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' ); $features_query = new WP_Query( $features_page_args ); /*The Loop*/ if ( $features_query->have_posts() ): $i = 1; while ( $features_query->have_posts() ):$features_query->the_post(); $icon = get_post_meta( get_the_ID(), 'nexas_icon', true ); ?>

defaults() ); /*default values*/ $nexas_features_title = esc_attr( $instance[ 'features_title' ] ); $features_background = esc_url( $instance['features_background'] ); $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 ); ?> 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 ); ?>

style="display:none;" > <?php esc_attr_e( 'Image preview', 'nexas' ); ?>