'widget_author', 'description' => esc_html__( 'Widget to display author profile.', 'blog-zone' ), ); parent::__construct( 'bz-author', esc_html__( 'BZ: Author Profile', 'blog-zone' ), $opts ); } function widget( $args, $instance ) { $author_page = !empty( $instance['author_page'] ) ? $instance['author_page'] : ''; 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(); ?>

'', ); $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-zone' ), ) ); ?>