'blog_way_widget_author', 'description' => esc_html__( 'Display Author Profile.', 'blog-way' ), ); parent::__construct( 'blog-way-author', esc_html__( 'Blog Way: Author Profile', 'blog-way' ), $opts ); } /** * Echo the widget content. * * @since 1.0.0 * * @param array $args Display arguments including before_title, after_title, * before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget. */ function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $author_page = !empty( $instance['author_page'] ) ? $instance['author_page'] : ''; $content_type = !empty( $instance['content_type'] ) ? $instance['content_type'] : ''; $excerpt_length = !empty( $instance['excerpt_length'] ) ? $instance['excerpt_length'] : 20; $read_more_text = !empty( $instance['read_more_text'] ) ? $instance['read_more_text'] : ''; $author_facebook = !empty( $instance['author_facebook'] ) ? $instance['author_facebook'] : ''; $author_twitter = !empty( $instance['author_twitter'] ) ? $instance['author_twitter'] : ''; $author_linkedin = !empty( $instance['author_linkedin'] ) ? $instance['author_linkedin'] : ''; $author_instagram = !empty( $instance['author_instagram'] ) ? $instance['author_instagram'] : ''; $author_pinterest = !empty( $instance['author_pinterest'] ) ? $instance['author_pinterest'] : ''; $author_youtube = !empty( $instance['author_youtube'] ) ? $instance['author_youtube'] : ''; echo $args['before_widget']; ?>
1, 'page_id' => absint( $author_page ), 'post_type' => 'page', 'post_status' => 'publish', ); $author_query = new WP_Query( $author_args ); if( $author_query->have_posts()){ while( $author_query->have_posts()){ $author_query->the_post(); ?>

'', 'author_page' => '', 'content_type' => 'full', 'excerpt_length' => 20, 'read_more_text' => esc_html__( 'Read More', 'blog-way' ), 'author_facebook' => '', 'author_twitter' => '', 'author_linkedin' => '', 'author_instagram' => '', 'author_pinterest' => '', 'author_youtube' => '', ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>

$this->get_field_id( 'author_page' ), 'class' => 'widefat', 'name' => $this->get_field_name( 'author_page' ), 'selected' => $instance[ 'author_page' ], 'show_option_none' => esc_html__( '— Select —', 'blog-way' ), ) ); ?>

dropdown_content_type( array( 'id' => $this->get_field_id( 'content_type' ), 'name' => $this->get_field_name( 'content_type' ), 'selected' => esc_attr( $instance['content_type'] ), ) ); ?>

'', 'class' => 'widefat', 'name' => '', 'selected' => 'full', ); $r = wp_parse_args( $args, $defaults ); $output = ''; $choices = array( 'full' => esc_html__( 'Full', 'blog-way' ), 'excerpt' => esc_html__( 'Excerpt', 'blog-way' ), ); if ( ! empty( $choices ) ) { $output = "\n"; } echo $output; } } endif;