WordPress.org

Making WordPress.org


Ignore:
Timestamp:
09/14/2017 12:21:08 AM (2 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.

File:
1 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 ) ) {
Note: See TracChangeset for help on using the changeset viewer.