From fa0190bcb1b528288ab121ef2afb1e441183dde3 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 21 Mar 2019 22:01:42 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@44975 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/ajax-actions.php | 7 ++++++- src/wp-admin/includes/theme.php | 6 +++--- src/wp-admin/theme-install.php | 7 ++++++- src/wp-includes/class-wp-customize-manager.php | 3 +++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index ea5090b588..474319e75c 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/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/src/wp-admin/includes/theme.php b/src/wp-admin/includes/theme.php index c0f72b3d42..1ab7959e5f 100644 --- a/src/wp-admin/includes/theme.php +++ b/src/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/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index 369cb87282..e0fa5cf230 100644 --- a/src/wp-admin/theme-install.php +++ b/src/wp-admin/theme-install.php @@ -335,7 +335,12 @@ if ( $tab ) { <# if ( data.rating ) { #>
{{{ data.stars }}} - ({{ data.num_ratings }}) + + +
<# } else { #> diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index ab3839ac43..e4e6dfa810 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/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 );