Making WordPress.org


Ignore:
Timestamp:
01/10/2017 08:33:47 AM (8 years ago)
Author:
dd32
Message:

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

As we're storing contributors in a taxonomy, this requires switching the taxonomy to a sorted taxonomy, and using a lower-level terms function, although one which still has caching.

Fixes #2363

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php

    r4565 r4620  
    133133
    134134        // Set categories if there aren't any yet. wp-admin takes precedent.
    135         if ( ! wp_get_post_terms( $plugin->ID, 'plugin_category', array( 'fields' => 'ids' ) ) ) {
    136             wp_set_post_terms( $plugin->ID, Tag_To_Category::map( $readme->tags ), 'plugin_category' );
     135        if ( ! wp_get_object_terms( $plugin->ID, 'plugin_category', array( 'fields' => 'ids' ) ) ) {
     136            wp_set_object_terms( $plugin->ID, Tag_To_Category::map( $readme->tags ), 'plugin_category' );
    137137        }
    138138
    139139        // Set tags from the readme
    140         wp_set_post_terms( $plugin->ID, $readme->tags, 'plugin_tags' );
     140        wp_set_object_terms( $plugin->ID, $readme->tags, 'plugin_tags' );
    141141
    142142        // Update the contributors list
    143         wp_set_post_terms( $plugin->ID, $readme->contributors, 'plugin_contributors' );
     143        wp_set_object_terms( $plugin->ID, $readme->contributors, 'plugin_contributors' );
    144144
    145145        // Update the committers list
     
    147147
    148148        if ( in_array( 'adopt-me', $readme->tags ) ) {
    149             wp_set_post_terms( $plugin->ID, array( 74 /* Term ID for adopt-me */ ), 'plugin_section' );
     149            wp_set_object_terms( $plugin->ID, 'adopt-me', 'plugin_section' );
    150150        }
    151151
Note: See TracChangeset for help on using the changeset viewer.