Changeset 5265
- Timestamp:
- 04/05/2017 10:56:02 PM (6 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-author-card.php
r5208 r5265 12 12 /** 13 13 * Displays information about the author of the current plugin. 14 * 15 * @param int|WP_Post $post_or_user_id The post or the ID of a specific user. 14 16 */ 15 public static function display( ) {17 public static function display( $post_or_user_id = '' ) { 16 18 global $wpdb; 17 19 … … 21 23 ), 10, 6 ); 22 24 23 $post = get_post(); 24 $author = get_user_by( 'id', $post->post_author ); 25 if ( is_int( $post_or_user_id ) ) { 26 $post = ''; 27 $author = get_user_by( 'id', $post_or_user_id ); 28 } else { 29 $post = $post_or_user_id ?: get_post(); 30 $author = get_user_by( 'id', $post->post_author ); 31 } 32 33 if ( ! $author ) { 34 return; 35 } 25 36 26 37 $author_commit = Tools::get_users_write_access_plugins( $author ); 27 $author_plugins = get_posts(array(38 $author_plugins_q = array( 28 39 'author' => $author->ID, 29 40 'post_type' => 'plugin', 30 'post__not_in' => array( $post->ID ), 31 ) ); 41 ); 42 if ( $post ) { 43 $author_plugins_q['post__not_in'] = array( $post->ID ); 44 } 45 $author_plugins = get_posts( $author_plugins_q ); 32 46 $all_plugins = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} WHERE post_name IN ('" . implode( "', '", array_merge( $author_commit, wp_list_pluck( $author_plugins, 'post_name' ) ) ) . "')" ); 33 47 ?> 34 <p class="profile"> 48 <div class="profile"> 49 <p class="profile-personal"> 35 50 <?php echo get_avatar( $author->ID, 48 ); ?> 36 51 <span class="profile-details"> … … 206 221 */ 207 222 do_action( 'wporg_plugins_author_card', $post, $author, $all_plugins ); 223 224 echo '</div>'; 208 225 } 209 226 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/css/edit-form.css
r4383 r5265 178 178 } 179 179 180 .profile > img{180 .profile .avatar { 181 181 float: left; 182 182 height: 48px;
Note: See TracChangeset
for help on using the changeset viewer.