__( 'Displays recent posts by an author on his/her posts as a responsive sidebar widget or in page/post using the shortcode', 'author-recent-posts' ) ) // Args ); } // widget form creation function form( $instance ) { $widgetID = str_replace( 'author_recent_posts-', '', $this->id ); // Check values $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; $numberofposts = isset( $instance['numberofposts'] ) ? absint( $instance['numberofposts'] ) : 5; $show_date = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : false; $showthumbnail = isset( $instance['showthumbnail'] ) ? (bool) $instance['showthumbnail'] : false; $showexcerpt = isset( $instance['showexcerpt'] ) ? (bool) $instance['showexcerpt'] : false; $width = isset( $instance['width'] ) ? absint( $instance['width'] ) : ''; $height = isset( $instance['height'] ) ? absint( $instance['height'] ) : ''; $alternateImg = isset( $instance['alternateImg'] ) ? esc_url( $instance['alternateImg'] ) : ''; ?>

/>

px

px

id="get_field_id( 'show_date' ); ?>" name="get_field_name( 'show_date' ); ?>"/>

Shortcode: [ft-authorrecentposts widget_id=""]

option_name ); $instance = $widgetOptions[ $widgetID ]; $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Author Recent Posts' ); $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $number = ( ! empty( $instance['numberofposts'] ) ) ? absint( $instance['numberofposts'] ) : 5; $showthumbnail = isset( $instance['showthumbnail'] ) ? $instance['showthumbnail'] : false; $width_image = empty( $instance['width'] ) ? '50' : absint( $instance['width'] ); $height_image = empty( $instance['height'] ) ? '50' : absint( $instance['height'] ); $alternateImg = ! empty( $instance['alternateImg'] ) ? esc_url( $instance['alternateImg'] ) : ''; $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false; extract($args, EXTR_SKIP); global $authordata, $post; $authors_posts = get_posts( array( 'author' => $authordata->ID, 'post__not_in' => array( $post->ID ), 'posts_per_page' => $number ) ); if ( count( $authors_posts ) > 0 ) : echo $before_widget; if ( $title ) { $author = get_the_author_meta( 'display_name', $authordata->ID ); $title = str_replace( '[author]', $author, $title ); $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); echo $before_title . $title . $after_title; } ?>