'', 'page_id' => '', 'title' => '', 'at_all_page_items' => '', 'background_options' => 'gray' ); function __construct() { parent::__construct( /*Base ID of your widget*/ 'event_star_accordion', /*Widget name will appear in UI*/ esc_html__('AT Accordion Section', 'event-star'), /*Widget description*/ array( 'description' => esc_html__( 'Suitable for FAQ and or other Accordion', 'event-star' ) ) ); } /*Widget Backend*/ public function form( $instance ) { $instance = wp_parse_args( (array) $instance, $this->defaults ); /*default values*/ $unique_id = esc_attr( $instance[ 'unique_id' ] ); $page_id = absint( $instance[ 'page_id' ] ); $title = esc_attr( $instance[ 'title' ] ); $at_all_page_items = $instance['at_all_page_items']; $background_options = esc_attr( $instance['background_options'] ); ?>



$page_id, 'name' => $this->get_field_name( 'page_id' ), 'id' => $this->get_field_id( 'page_id' ), 'class' => 'widefat', 'show_option_none' => esc_html__('Select Page','event-star'), 'option_none_value' => 0 // string ); wp_dropdown_pages( $args ); ?>


0 && is_array($at_all_page_items) ){ foreach ($at_all_page_items as $about){ $repeater_id = $this->get_field_id( 'at_all_page_items') .$total_repeater.'page_id'; $repeater_name = $this->get_field_name( 'at_all_page_items' ).'['.$total_repeater.']['.'page_id'.']'; ?>

get_field_id( 'at_all_page_items') .$coder_repeater_depth.'page_id'; $repeater_name = $this->get_field_name( 'at_all_page_items' ).'['.$coder_repeater_depth.']['.'page_id'.']'; ?> '; $add_field = esc_html__('Add Item', 'event-star'); echo ''.$add_field.'
'; ?>

0 && is_array($at_all_page_items) ){ foreach ($at_all_page_items as $key=>$about ){ $page_ids[$key]['page_id'] = event_star_sanitize_page( $about['page_id'] ); } } } $instance['at_all_page_items'] = $page_ids; $event_star_widget_background_options = event_star_background_options(); $instance[ 'background_options' ] = event_star_sanitize_choice_options( $new_instance[ 'background_options' ], $event_star_widget_background_options, 'default' ); return $instance; } /** * 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) { $instance = wp_parse_args( (array) $instance, $this->defaults); /*default values*/ $unique_id = !empty( $instance[ 'unique_id' ] ) ? esc_attr( $instance[ 'unique_id' ] ) : esc_attr( $this->id ); $page_id = absint( $instance[ 'page_id' ] ); $title = apply_filters( 'widget_title', !empty( $instance['title'] ) ? $instance['title'] : '', $instance, $this->id_base ); $at_all_page_items = $instance['at_all_page_items']; $background_options = esc_attr( $instance['background_options'] ); $bg_gray_class = $background_options == 'gray'?'at-gray-bg':''; echo $args['before_widget']; ?>
0 && is_array($at_all_page_items) ){ foreach ( $at_all_page_items as $about ){ if( isset( $about['page_id'] ) && !empty( $about['page_id'] ) ){ $post_in[] = $about['page_id']; } } } if( !empty ( $post_in ) ) : $event_star_post_in_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' ); $accordion_query = new WP_Query( $event_star_post_in_page_args ); /*The Loop*/ if ( $accordion_query->have_posts() ): $i=1; while( $accordion_query->have_posts() ):$accordion_query->the_post(); $accordion_icon = $i!=1?'fa-plus':'fa-minus' ?>
$page_id, 'posts_per_page' => 1, 'post_type' => 'page', 'no_found_rows' => true, 'post_status' => 'publish' ); $service_query = new WP_Query( $event_star_post_in_page_args ); /*The Loop*/ if ( $service_query->have_posts() ): while( $service_query->have_posts() ):$service_query->the_post(); ?>
', '' ); ?>