From 35b29f11b35503f64a5d63ead1dc191ea5baffdb Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 15 Dec 2019 08:45:05 +0000 Subject: [PATCH] Coding Standards: Add missing braces to `if` conditions in `js/_enqueues/wp/util.js`. Props ankitmaru. Fixes #48980. Built from https://develop.svn.wordpress.org/trunk@46960 git-svn-id: http://core.svn.wordpress.org/trunk@46760 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/wp-util.js | 15 ++++++++++----- wp-includes/version.php | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/wp-includes/js/wp-util.js b/wp-includes/js/wp-util.js index 9befe512a1..836d0016f2 100644 --- a/wp-includes/js/wp-util.js +++ b/wp-includes/js/wp-util.js @@ -94,10 +94,13 @@ window.wp = window.wp || {}; deferred = $.Deferred( function( deferred ) { // Transfer success/error callbacks. - if ( options.success ) + if ( options.success ) { deferred.done( options.success ); - if ( options.error ) + } + + if ( options.error ) { deferred.fail( options.error ); + } delete options.success; delete options.error; @@ -105,13 +108,15 @@ window.wp = window.wp || {}; // Use with PHP's wp_send_json_success() and wp_send_json_error() deferred.jqXHR = $.ajax( options ).done( function( response ) { // Treat a response of 1 as successful for backward compatibility with existing handlers. - if ( response === '1' || response === 1 ) + if ( response === '1' || response === 1 ) { response = { success: true }; + } - if ( _.isObject( response ) && ! _.isUndefined( response.success ) ) + if ( _.isObject( response ) && ! _.isUndefined( response.success ) ) { deferred[ response.success ? 'resolveWith' : 'rejectWith' ]( this, [response.data] ); - else + } else { deferred.rejectWith( this, [response] ); + } }).fail( function() { deferred.rejectWith( this, arguments ); }); diff --git a/wp-includes/version.php b/wp-includes/version.php index 15bab24d04..4734c99cc1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-46959'; +$wp_version = '5.4-alpha-46960'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.