WordPress.org

Making WordPress.org

Changeset 9299


Ignore:
Timestamp:
11/26/2019 04:20:16 PM (2 years ago)
Author:
ocean90
Message:

Translate: Use new user meta key for plugin favorites.

Fixes #4876.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-locale.php

    r8558 r9299  
    935935                // Fall through to include both Themes and Plugins
    936936            case 'wp-themes':
    937                 // Theme favorites are stored as theme slugs, these map 1:1 to GlotPress projects
     937                // Theme favorites are stored as theme slugs, these map 1:1 to GlotPress projects.
    938938                $theme_favorites = array_map( function( $slug ) {
    939939                    return "wp-themes/$slug";
     
    945945
    946946            case 'wp-plugins':
    947                 // Plugin favorites are stored as topic ID's
    948                 $plugin_fav_ids = array_keys( (array) get_user_meta( $user_id, PLUGINS_TABLE_PREFIX . 'plugin_favorite', true ) );
    949                 $plugin_fav_slugs = array();
    950                 if ( $plugin_fav_ids ) {
    951                     $plugin_fav_ids = implode( ',', array_map( 'intval', $plugin_fav_ids ) );
    952                     $plugin_fav_slugs = $wpdb->get_col( "SELECT topic_slug FROM " . PLUGINS_TABLE_PREFIX . "topics WHERE topic_id IN( $plugin_fav_ids )" );
    953                 }
    954 
     947                // Plugin favorites are stored as plugin slugs, these map 1:1 to GlotPress projects.
    955948                $plugin_favorites = array_map( function( $slug ) {
    956949                    return "wp-plugins/$slug";
    957                 }, $plugin_fav_slugs );
     950                }, (array) get_user_meta( $user_id, 'plugin_favorites', true ) );
    958951
    959952                if ( 'wp-plugins' === $project_slug ) {
Note: See TracChangeset for help on using the changeset viewer.