v1.2.5
This commit is contained in:
parent
891736d707
commit
0c4fda16c0
1 changed files with 615 additions and 454 deletions
29
assets/js/manager-notice.js
Normal file
29
assets/js/manager-notice.js
Normal 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
|
||||
} );
|
||||
} );
|
||||
}() );
|
||||
Loading…
Reference in a new issue