This commit is contained in:
Javier Casares 2026-08-18 12:00:07 +00:00
commit 0c4fda16c0

View file

@ -0,0 +1,29 @@
/**
* Persists the dismissal of the Manager (by ROBOTSTXT) admin notice.
*
* WordPress only hides a dismissible notice for the current page load;
* this script stores the dismissal so it does not come back.
*/
( function () {
'use strict';
document.addEventListener( 'click', function ( event ) {
var notice = event.target.closest
? event.target.closest( '.robotstxt-hello-manager-notice .notice-dismiss' )
: null;
if ( ! notice ) {
return;
}
var data = new FormData();
data.append( 'action', 'robotstxt_hello_dismiss_manager_notice' );
data.append( 'nonce', window.robotstxthellomanagernotice.nonce );
window.fetch( window.robotstxthellomanagernotice.ajaxUrl, {
method: 'POST',
credentials: 'same-origin',
body: data
} );
} );
}() );