From 30491f241069443055f186ae7475b7ea9017d42c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 21 Mar 2019 22:02:51 +0000 Subject: [PATCH] Customize: Add a link to theme reviews in the theme details modal in the Customizer and on Add Themes screen. Props celloexpressions, Travel_girl, Ixium, marco-peralta, dd32. Fixes #36612. Built from https://develop.svn.wordpress.org/trunk@44975 git-svn-id: http://core.svn.wordpress.org/trunk@44806 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 7 ++++++- wp-admin/includes/theme.php | 6 +++--- wp-admin/theme-install.php | 7 ++++++- wp-includes/class-wp-customize-manager.php | 3 +++ wp-includes/version.php | 2 +- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index ea5090b588..474319e75c 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -3266,7 +3266,12 @@ function wp_ajax_query_themes() { wp_unslash( $_REQUEST['request'] ), array( 'per_page' => 20, - 'fields' => $theme_field_defaults, + 'fields' => array_merge( + (array) $theme_field_defaults, + array( + 'reviews_url' => true, // Explicitly request the reviews URL to be linked from the Add Themes screen. + ) + ), ) ); diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index c0f72b3d42..1ab7959e5f 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -721,12 +721,12 @@ function customize_themes_print_templates() { <# if ( data.stars && 0 != data.num_ratings ) { #>
{{{ data.stars }}} - + link to view ratings opens in a new tab' ), '{{ data.num_ratings }}' ); ?> - +
<# } #> diff --git a/wp-admin/theme-install.php b/wp-admin/theme-install.php index 369cb87282..e0fa5cf230 100644 --- a/wp-admin/theme-install.php +++ b/wp-admin/theme-install.php @@ -335,7 +335,12 @@ if ( $tab ) { <# if ( data.rating ) { #>
{{{ data.stars }}} - ({{ data.num_ratings }}) + + +
<# } else { #> diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index ab3839ac43..e4e6dfa810 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -5729,6 +5729,9 @@ final class WP_Customize_Manager { // Arguments for all queries. $wporg_args = array( 'per_page' => 100, + 'fields' => array( + 'reviews_url' => true, // Explicitly request the reviews URL to be linked from the customizer. + ), ); $args = array_merge( $wporg_args, $args ); diff --git a/wp-includes/version.php b/wp-includes/version.php index b4bf67f113..4e0553e7b6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-alpha-44974'; +$wp_version = '5.2-alpha-44975'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.