Plugins: Revert r58081 show an admin notice on successful activation.

With a new direction in the 6.5.4 to restore the Activate button's href (see [58250]), the changesets committed for 6.5.3 (see #60992) are now dead code and will not render the admin notice on successful plugin activation.

This commit is a clean revert of r58081.

Follow-up to [58250].

Props swissspidy, azaozz, costdev, jorbin, hellofromTonya, afragen.
Fixes #61331.
See #60992, #61319.
Built from https://develop.svn.wordpress.org/trunk@58257


git-svn-id: http://core.svn.wordpress.org/trunk@57720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2024-05-30 17:09:10 +00:00
parent 8f7d5cf1ca
commit 4b331a84ef
7 changed files with 15 additions and 102 deletions

View File

@ -1520,25 +1520,6 @@ div.error {
margin-top: -5px;
}
#plugin-information-footer #plugin-activated-successfully {
margin-bottom: 0;
}
#plugin-information-footer #plugin-activated-successfully p {
display: flex;
gap: 1em;
align-items: center;
justify-content: space-between;
margin: 0;
}
#plugin-information-footer #plugin-activated-successfully .refresh-page {
flex-grow: 0;
line-height: 2.15384615;
min-height: 0;
margin-bottom: 0;
}
.update-message p:before,
.updating-message p:before,
.updated-message p:before,

File diff suppressed because one or more lines are too long

View File

@ -1519,25 +1519,6 @@ div.error {
margin-top: -5px;
}
#plugin-information-footer #plugin-activated-successfully {
margin-bottom: 0;
}
#plugin-information-footer #plugin-activated-successfully p {
display: flex;
gap: 1em;
align-items: center;
justify-content: space-between;
margin: 0;
}
#plugin-information-footer #plugin-activated-successfully .refresh-page {
flex-grow: 0;
line-height: 2.15384615;
min-height: 0;
margin-bottom: 0;
}
.update-message p:before,
.updating-message p:before,
.updated-message p:before,

File diff suppressed because one or more lines are too long

View File

@ -1112,26 +1112,14 @@
*/
wp.updates.activatePluginSuccess = function( response ) {
var $message = $( '.plugin-card-' + response.slug + ', #plugin-information-footer' ).find( '.activating-message' ),
isInModal = 'plugin-information-footer' === $message.parent().attr( 'id' ),
buttonText = _x( 'Activated!', 'plugin' ),
ariaLabel = sprintf(
/* translators: %s: The plugin name. */
'%s activated successfully.',
response.pluginName
),
noticeData = {
id: 'plugin-activated-successfully',
className: 'notice-success',
message: sprintf(
/* translators: %s: The refresh link's attributes. */
__( 'Plugin activated. Some changes may not occur until you refresh the page. <a %s>Refresh Now</a>' ),
'href="#" class="button button-secondary refresh-page"'
),
slug: response.slug
},
noticeTarget;
);
wp.a11y.speak( __( 'Activation completed successfully. Some changes may not occur until you refresh the page.' ) );
wp.a11y.speak( __( 'Activation completed successfully.' ) );
$document.trigger( 'wp-plugin-activate-success', response );
$message
@ -1140,7 +1128,7 @@
.attr( 'aria-label', ariaLabel )
.text( buttonText );
if ( isInModal ) {
if ( 'plugin-information-footer' === $message.parent().attr( 'id' ) ) {
wp.updates.setCardButtonStatus(
{
status: 'activated-plugin',
@ -1151,26 +1139,13 @@
ariaLabel: ariaLabel
}
);
// Add a notice to the modal's footer.
$message.replaceWith( wp.updates.adminNotice( noticeData ) );
// Send notice information back to the parent screen.
noticeTarget = window.parent === window ? null : window.parent;
$.support.postMessage = !! window.postMessage;
if ( false !== $.support.postMessage && null !== noticeTarget && -1 === window.parent.location.pathname.indexOf( 'index.php' ) ) {
noticeTarget.postMessage(
JSON.stringify( noticeData ),
window.location.origin
);
}
} else {
// Add a notice to the top of the screen.
wp.updates.addAdminNotice( noticeData );
}
setTimeout( function() {
if ( isInModal ) {
$message.removeClass( 'activated-message' )
.text( _x( 'Active', 'plugin' ) );
if ( 'plugin-information-footer' === $message.parent().attr( 'id' ) ) {
wp.updates.setCardButtonStatus(
{
status: 'plugin-active',
@ -1184,8 +1159,6 @@
)
}
);
} else {
$message.removeClass( 'activated-message' ).text( _x( 'Active', 'plugin' ) );
}
}, 1000 );
};
@ -3256,11 +3229,6 @@
return;
}
if ( 'undefined' !== typeof message.id && 'plugin-activated-successfully' === message.id ) {
wp.updates.addAdminNotice( message );
return;
}
if (
'undefined' !== typeof message.status &&
'undefined' !== typeof message.slug &&
@ -3493,22 +3461,5 @@
} );
}
);
/**
* Click handler for page refresh link.
*
* @since 6.5.3
*
* @param {Event} event Event interface.
*/
$document.on( 'click', '.refresh-page', function( event ) {
event.preventDefault();
if ( window.parent === window ) {
window.location.reload();
} else {
window.parent.location.reload();
}
} );
} );
})( jQuery, window.wp, window._wpUpdatesSettings );

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-alpha-58256';
$wp_version = '6.6-alpha-58257';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.