'', 'bg_image' => '', 'title' => '', 'at_all_page_items' => '', 'content_from' => 'excerpt', 'content_number' => -1, ); function __construct() { parent::__construct( /*Base ID of your widget*/ 'beauty_studio_testimonial', /*Widget name will appear in UI*/ esc_html__('AT Testimonial Section', 'beauty-studio'), /*Widget description*/ array( 'description' => esc_html__( 'Show Testimonial Section.', 'beauty-studio' ) ) ); } /*Widget Backend*/ public function form( $instance ) { $instance = wp_parse_args( (array) $instance, $this->defaults ); /*default values*/ $unique_id = esc_attr( $instance[ 'unique_id' ] ); $bg_image = esc_url( $instance[ 'bg_image' ] ); $title = esc_attr( $instance[ 'title' ] ); $at_all_page_items = $instance['at_all_page_items']; $content_from = esc_attr( $instance['content_from'] ); $content_number = intval( $instance['content_number'] ); ?>


> <?php esc_attr_e( 'Image preview', 'beauty-studio' ); ?>


0 ){ 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', 'beauty-studio'); echo ''.$add_field.'
'; ?>


0 ){ foreach ($at_all_page_items as $key=>$about ){ $page_ids[$key]['page_id'] = beauty_studio_sanitize_page( $about['page_id'] ); } } } $instance['at_all_page_items'] = $page_ids; $beauty_studio_about_content_from = beauty_studio_content_from(); $instance['content_from'] = beauty_studio_sanitize_choice_options( $new_instance['content_from'], $beauty_studio_about_content_from, 'excerpt' ); $instance['content_number'] = intval( $new_instance['content_number'] ); 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 ); $bg_image = esc_url( $instance['bg_image'] ); $title = apply_filters( 'widget_title', !empty( $instance['title'] ) ? $instance['title'] : '', $instance, $this->id_base ); $at_all_page_items = $instance['at_all_page_items']; $content_from = esc_attr( $instance['content_from'] ); $content_number = intval( $instance['content_number'] ); echo $args['before_widget']; $bg_image_style = ''; if ( !empty( $bg_image ) ) { $bg_image_style .= 'background-image:url(' . $bg_image . ');background-repeat:no-repeat;background-size:cover;background-attachment:fixed;background-position: center;'; $bg_image_class = 'at-parallax'; } else{ $bg_image_class = 'at-no-parallax'; } $animation = "init-animate zoomIn"; ?>
"; if ( ! empty( $title ) ) { echo $args['before_title'] . esc_html( $title ) . $args['after_title']; } echo "
"; } ?>
0 ){ 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 ) ) : $beauty_studio_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' ); $testimonial_query = new WP_Query( $beauty_studio_post_in_page_args ); /*The Loop*/ if ( $testimonial_query->have_posts() ): echo "
"; while( $testimonial_query->have_posts() ):$testimonial_query->the_post(); $b_col = " col-sm-12"; ?> "; endif; wp_reset_postdata(); endif; ?>