'blogger text-center', 'description' => esc_html__( 'Display Author Bio.', 'blog-mantra' ), ); parent::__construct( 'blog-mantra-author-bio', esc_html__( 'Blog Mantra: Author Bio', 'blog-mantra' ), $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_bio_page = !empty( $instance['author_bio_page'] ) ? $instance['author_bio_page'] : ''; $content_type = !empty( $instance['content_type'] ) ? $instance['content_type'] : ''; $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'] : ''; echo $args['before_widget']; ?>
esc_attr( $this->get_field_id( 'author_bio_page' ) ), 'class' => 'widefat', 'name' => esc_attr( $this->get_field_name( 'author_bio_page' ) ), 'selected' => $instance[ 'author_bio_page' ], 'show_option_none' => esc_html__( '— Select —', 'blog-mantra' ), ) ); ?>
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-mantra' ), 'excerpt' => esc_html__( 'Excerpt', 'blog-mantra' ), ); if ( ! empty( $choices ) ) { $output = "\n"; } echo $output; } } endif; /** * Register widget. * * Calls 'widgets_init' action after widget has been registered. */ function blog_mantra_author_bio_init() { register_widget('Blog_Mantra_Author_Bio_Widget'); } add_action('widgets_init', 'blog_mantra_author_bio_init');