__( 'Displays Author specific tags with post count', 'wpb_author_tags_domain' ), ) ); } // Widget Backend public function form( $instance ) { if ( isset( $instance[ 'title' ] ) ) { $title = $instance[ 'title' ]; } else { $title = __( 'Author Tags', 'wpb_author_tags_domain' ); } // Widget admin form ?>

post_author; $postargs = array( 'posts_per_page' => 20, 'ignore_sticky_posts' => 1, 'author' => $current_user_id ); //$author_posts = new WP_Query($postargs); $author_posts = get_posts( $postargs ); $cnt = count($author_posts); foreach( $author_posts as $author_posts_all){ $get_tags[$cnt] = wp_get_post_tags( $author_posts_all->ID ) ;$cnt--; } echo $args['before_widget']; if ( ! empty( $title ) ) $authorname = get_the_author_meta( 'display_name', $current_user_id ); $title = str_replace('[authorname]', $authorname.'\'s', $title); echo $args['before_title'] . $title . $args['after_title']; foreach( $get_tags as $alltags){ foreach( $alltags as $alltags){ $count_tags[] = $alltags->name;} } $count_tags = array_count_values($count_tags); foreach( $count_tags as $key => $value){ ?>