Making WordPress.org


Ignore:
Timestamp:
07/16/2018 02:08:11 AM (8 years ago)
Author:
dd32
Message:

Theme Directory: API: Add a reviews_url field to the API to allow WordPress to link to the reviews without manually building the url.

See ​https://core.trac.wordpress.org/ticket/36612

File:
1 edited

Legend:

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

    r6553 r7467  
    4949                'rating'             => false,
    5050                'ratings'            => false,
     51                'reviews_url'        => false,
    5152                'screenshot_count'   => false,
    5253                'screenshot_url'     => true,
    … …  
    358359                        $defaults['extended_author'] = true;
    359360                        $defaults['num_ratings'] = true;
    360                         $detaults['parent'] = true;
     361                        $defaults['reviews_url'] = true;
     362                        $defaults['parent'] = true;
    361363                }
    362364
    … …  
    672674                        $phil->rating = \WPORG_Ratings::get_avg_rating( 'theme', $theme->post_name ) * 20;
    673675                        $phil->num_ratings = \WPORG_Ratings::get_rating_count( 'theme', $theme->post_name );
     676                }
     677
     678                if ( $this->fields['reviews_url'] ) {
     679                        $phil->reviews_url = 'https://wordpress.org/support/theme/' . $theme->post_name . '/reviews/';
    674680                }
    675681
Note: See TracChangeset for help on using the changeset viewer.