Making WordPress.org


Ignore:
Timestamp:
06/08/2023 02:34:42 AM (3 years ago)
Author:
dd32
Message:

Theme Directory: Refactor the API calls to properly query the user with favorites.

This reverts [12630] which was a quick-fix for the issue, but it was actually caused by [12600].

This refactors the API query code to avoid using jsonp requests for ease of debugging, and slims down the request to what it actually needs to query for.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-themes-api.php

    r12630 r12632  
    123123                // Favorites requests require a user to fetch favorites for.
    124124                if ( isset( $this->request->browse ) && 'favorites' === $this->request->browse && ! isset( $this->request->user ) ) {
    125                         if ( is_user_logged_in() ) {
    126                                 $this->request->user = wp_get_current_user()->user_nicename;
    127                         } else {
    128                                 $this->request->user = '';
    129                                 $this->bad_input = true;
    130                         }
     125                        $this->request->user = '';
     126                        $this->bad_input = true;
    131127                }
    132128
Note: See TracChangeset for help on using the changeset viewer.