Making WordPress.org

Changeset 5924


Ignore:
Timestamp:
09/14/2017 12:21:08 AM (9 years ago)
Author:
dd32
Message:

Plugin Directory: Sort the Contributors & Developers field in the order that it appears in the readme.

This was previously fixed in [4620] for one location, which was later changed. This updates the other two locations which were originally missed.

Fixes #2363.

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  
    7777                $result['contributors'] = array();
    7878
    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 ) {
    8291                        $contributors = array();
    8392                        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  
    2828        public function widget( $args, $instance ) {
    2929                $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                }
    3141
    3242                if ( $contributors ) {
    33                         $contributors = (array) wp_list_pluck( $contributors, 'name' );
    3443                        $contributors = array_map( function( $user_nicename ) {
    3544                                return get_user_by( 'slug', $user_nicename );
Note: See TracChangeset for help on using the changeset viewer.