Coding standards: Site health: Avoid to use var in the middle of JavaScript function blocks.

Amends [45178].
See #46683.


git-svn-id: https://develop.svn.wordpress.org/trunk@45197 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia 2019-04-14 13:48:59 +00:00
parent d52d60c809
commit 5c9d27cd17

View File

@ -56,11 +56,12 @@ jQuery( document ).ready( function( $ ) {
function AppendIssue( issue ) { function AppendIssue( issue ) {
var template = wp.template( 'health-check-issue' ), var template = wp.template( 'health-check-issue' ),
issueWrapper = $( '#health-check-issues-' + issue.status ), issueWrapper = $( '#health-check-issues-' + issue.status ),
heading; heading,
count;
SiteHealth.site_status.issues[ issue.status ]++; SiteHealth.site_status.issues[ issue.status ]++;
var count = SiteHealth.site_status.issues[ issue.status ]; count = SiteHealth.site_status.issues[ issue.status ];
if ( 'critical' === issue.status ) { if ( 'critical' === issue.status ) {
heading = sprintf( _n( '%s Critical issue', '%s Critical issues', count ), '<span class="issue-count">' + count + '</span>' ); heading = sprintf( _n( '%s Critical issue', '%s Critical issues', count ), '<span class="issue-count">' + count + '</span>' );
@ -145,9 +146,11 @@ jQuery( document ).ready( function( $ ) {
} }
); );
// translators: %s: The percentage score for the tests. wp.a11y.speak( sprintf(
var text = __( 'All site health tests have finished running. Your site scored %s, and the results are now available on the page.' ); // translators: %s: The percentage score for the tests.
wp.a11y.speak( sprintf( text, val + '%' ) ); __( 'All site health tests have finished running. Your site scored %s, and the results are now available on the page.' ),
val + '%'
) );
} }
} }