The User Photo plugin does not appear to be installed.
'; return; } echo userphoto__get_userphoto( $this->ID, USERPHOTO_FULL_SIZE, $before, $after, $attributes, $default_src ); } /** * Template function. Hooks into the User Photo plugin functionality to display a thumbnail IMG for the author. * * @param string $before optional A string to place before the user thumbnail, can contain HTML * @param string $after optional A string to place after the user thumbnail, can contain HTML * @param array $attributes optional An array of attributes to put in the IMG element * @param string $default_src optional A default image to use if one is not available/approved * @return void * @author Simon Wheatley **/ public function user_thumbnail( $before = '', $after = '', $attributes = array(), $default_src = '' ) { if ( ! function_exists( 'userphoto__get_userphoto' ) ) { echo 'The User Photo plugin does not appear to be installed.
'; return; } echo userphoto__get_userphoto( $this->ID, USERPHOTO_THUMBNAIL_SIZE, $before, $after, $attributes, $default_src ); } /** * A getter to return the latest post by this particular author, caching it the * first time it does so to reduce DB load. * * @return object The latest post by this author. * @author Simon Wheatley **/ protected function get_latest_post() { // Maybe we've found and cached this already if ( ! empty( $this->latest_post ) ) return $this->latest_post; // ...obviously not $this->latest_post = get_post( $this->latest_post_id() ); return $this->latest_post; } /** * A method to return the ID for the latest post by this particular author. * * @return integer The ID for the latest post by this particular author. * @author Simon Wheatley **/ protected function latest_post_id() { global $wpdb; $unprepared_sql = "SELECT ID FROM $wpdb->posts WHERE post_author = %d AND post_status = 'publish' AND post_type = 'post' "; if ( ! $this->include_protected_posts ) $unprepared_sql .= "AND ( post_password IS NULL OR post_password = '' ) "; $unprepared_sql .= "ORDER BY post_date_gmt DESC LIMIT 1 "; $sql = $wpdb->prepare( $unprepared_sql, $this->ID ); return $wpdb->get_var( $sql ); } } ?>