diff --git a/wp-admin/authorize-application.php b/wp-admin/authorize-application.php index fa8d919747..0afdd53082 100644 --- a/wp-admin/authorize-application.php +++ b/wp-admin/authorize-application.php @@ -200,15 +200,19 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
diff --git a/wp-admin/js/auth-app.js b/wp-admin/js/auth-app.js index ad4403032d..b4b8ddbda5 100644 --- a/wp-admin/js/auth-app.js +++ b/wp-admin/js/auth-app.js @@ -62,6 +62,9 @@ /** * Fires when an Authorize Application Password request has been successfully approved. * + * In most cases, this should be used in combination with the {@see 'wp_authorize_application_password_form_approved_no_js'} + * action to ensure that both the JS and no-JS variants are handled. + * * @since 5.6.0 * * @param {Object} response The response from the REST API. @@ -126,13 +129,14 @@ * Fires when an Authorize Application Password request encountered an error when trying to approve the request. * * @since 5.6.0 + * @since 5.6.1 Corrected action name and signature. * * @param {Object|null} error The error from the REST API. May be null if the server did not send proper JSON. * @param {string} textStatus The status of the request. * @param {string} errorThrown The error message associated with the response status code. * @param {jqXHR} jqXHR The underlying jqXHR object that made the request. */ - wp.hooks.doAction( 'wp_application_passwords_approve_app_request_success', error, textStatus, jqXHR ); + wp.hooks.doAction( 'wp_application_passwords_approve_app_request_error', error, textStatus, errorThrown, jqXHR ); } ); } ); diff --git a/wp-admin/js/auth-app.min.js b/wp-admin/js/auth-app.min.js index 6695f4dc1a..ea1fee576c 100644 --- a/wp-admin/js/auth-app.min.js +++ b/wp-admin/js/auth-app.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(r,l){var o=r("#app_name"),i=r("#approve"),e=r("#reject"),d=o.closest("form"),p={userLogin:l.user_login,successUrl:l.success,rejectUrl:l.reject};i.click(function(e){var n=o.val(),a=r('input[name="app_id"]',d).val();if(e.preventDefault(),!i.prop("aria-disabled"))if(0!==n.length){i.prop("aria-disabled",!0).addClass("disabled");var s={name:n};0'+wp.i18n.__("Your new password for %s is:")+"","")+' ',t=r("
").attr("role","alert").attr("tabindex",-1).addClass("notice notice-success notice-alt").append(r("

").addClass("application-password-display").html(p)).append("

"+wp.i18n.__("Be sure to save this in a safe location. You will not be able to retrieve it.")+"

"),r("strong",t).text(n),r("input",t).val(e.password),d.replaceWith(t),t.focus())}).fail(function(e,a,s){var o=s,p=null;e.responseJSON&&(p=e.responseJSON).message&&(o=p.message);var t=r("
").attr("role","alert").addClass("notice notice-error").append(r("

").text(o));r("h1").after(t),i.removeProp("aria-disabled",!1).removeClass("disabled"),wp.hooks.doAction("wp_application_passwords_approve_app_request_success",p,a,e)})}else o.focus()}),e.click(function(e){e.preventDefault(),wp.hooks.doAction("wp_application_passwords_reject_app",p),window.location=l.reject}),d.on("submit",function(e){e.preventDefault()})}(jQuery,authApp); \ No newline at end of file +!function(n,l){var o=n("#app_name"),r=n("#approve"),e=n("#reject"),d=o.closest("form"),p={userLogin:l.user_login,successUrl:l.success,rejectUrl:l.reject};r.click(function(e){var i=o.val(),a=n('input[name="app_id"]',d).val();if(e.preventDefault(),!r.prop("aria-disabled"))if(0!==i.length){r.prop("aria-disabled",!0).addClass("disabled");var s={name:i};0'+wp.i18n.__("Your new password for %s is:")+"","")+' ',t=n("
").attr("role","alert").attr("tabindex",-1).addClass("notice notice-success notice-alt").append(n("

").addClass("application-password-display").html(p)).append("

"+wp.i18n.__("Be sure to save this in a safe location. You will not be able to retrieve it.")+"

"),n("strong",t).text(i),n("input",t).val(e.password),d.replaceWith(t),t.focus())}).fail(function(e,a,s){var o=s,p=null;e.responseJSON&&(p=e.responseJSON).message&&(o=p.message);var t=n("
").attr("role","alert").addClass("notice notice-error").append(n("

").text(o));n("h1").after(t),r.removeProp("aria-disabled",!1).removeClass("disabled"),wp.hooks.doAction("wp_application_passwords_approve_app_request_error",p,a,s,e)})}else o.focus()}),e.click(function(e){e.preventDefault(),wp.hooks.doAction("wp_application_passwords_reject_app",p),window.location=l.reject}),d.on("submit",function(e){e.preventDefault()})}(jQuery,authApp); \ No newline at end of file diff --git a/wp-includes/version.php b/wp-includes/version.php index 23d8a5db6a..c7afc97dc5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.7-alpha-49919'; +$wp_version = '5.7-alpha-49920'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.