esc_html__( 'Widget for your profile.', 'blogberg' ), 'customize_selective_refresh' => true ); parent::__construct( 'blogberg_author_widget', esc_html__( 'Blogberg Author', 'blogberg' ), $widget_ops ); $this->fields = array( 'title' => array( 'label' => esc_html__( 'Title', 'blogberg' ), 'type' => 'text', 'default' => esc_html__( 'About the Author', 'blogberg' ) ), 'page_id' => array( 'label' => esc_html__( 'Select Page', 'blogberg' ), 'type' => 'dropdown-pages', ), 'sub_title' => array( 'label' => esc_html__( 'Sub Title', 'blogberg' ), 'type' => 'text', 'default' => esc_html__( 'Lifestyle Blogger','blogberg' ) ), 'social_menu' => array( 'label' => esc_html__( 'Select Social Menu', 'blogberg' ), 'type' => 'dropdown-menus', ) ); } public function widget( $args, $instance ) { echo $args[ 'before_widget' ]; $instance = $this->init_defaults( $instance ); $unique_id = uniqid(); ?>
' . $args[ 'before_title'] . esc_html( $instance[ 'title' ] ) . $args[ 'after_title' ] . ''; $query = new WP_Query( array( 'p' => $instance[ 'page_id' ], 'post_type' => 'page' ) ); while( $query->have_posts() ){ $query->the_post(); if( has_post_thumbnail() ){ $src = get_the_post_thumbnail_url( get_the_ID(), 'thumbnail' ); }else{ $src = blogberg_get_dummy_image( array( 'size' => 'thumbnail' ) ); } ?>
', '' ); ?>
get_menu( $instance[ 'social_menu' ] ); ?>