Changeset 5924
- Timestamp:
- 09/14/2017 12:21:08 AM (7 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/api/routes/class-plugin.php
r5841 r5924 77 77 $result['contributors'] = array(); 78 78 79 if ( $contributors = get_the_terms( $post->ID, 'plugin_contributors' ) ) { 80 $contributors = wp_list_pluck( $contributors, 'slug' ); 81 } else { 79 $contributors = get_terms( array( 80 'taxonomy' => 'plugin_contributors', 81 'object_ids' => array( $post->ID ), 82 'orderby' => 'term_order', 83 'fields' => 'names', 84 ) ); 85 86 if ( is_wp_error( $contributors ) ) { 87 $contributors = array(); 88 } 89 90 if ( ! $contributors ) { 82 91 $contributors = array(); 83 92 if ( $author = get_user_by( 'id', $post->post_author ) ) { -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-contributors.php
r5310 r5924 28 28 public function widget( $args, $instance ) { 29 29 $post = get_post(); 30 $contributors = get_the_terms( $post, 'plugin_contributors' ); 30 31 $contributors = get_terms( array( 32 'taxonomy' => 'plugin_contributors', 33 'object_ids' => array( $post->ID ), 34 'orderby' => 'term_order', 35 'fields' => 'names', 36 ) ); 37 38 if ( is_wp_error( $contributors ) ) { 39 return; 40 } 31 41 32 42 if ( $contributors ) { 33 $contributors = (array) wp_list_pluck( $contributors, 'name' );34 43 $contributors = array_map( function( $user_nicename ) { 35 44 return get_user_by( 'slug', $user_nicename );
Note: See TracChangeset
for help on using the changeset viewer.