wp-admin/includes/class-wp-dismiss-notice.php
/**
	 * Handles Ajax request to persist notices dismissal.
	 * Uses check_ajax_referer to verify nonce.
	 */
Handles Ajax request to persist notices dismissal.
Uses check_ajax_referer to verify nonce.
Handles Ajax request to persist notices dismissal . Uses check_ajax_referer to verify nonce .
public static function dismiss_admin_notice() {
		$option_name        = isset( $_POST['option_name'] ) ? sanitize_text_field( wp_unslash( $_POST['option_name'] ) ) : false;
		$dismissible_length = isset( $_POST['dismissible_length'] ) ? sanitize_text_field( wp_unslash( $_POST['dismissible_length'] ) ) : 1;
		if ( 'forever' !== $dismissible_length ) {
			$dismissible_length = ( 0 === absint( $dismissible_length ) ) ? 1 : $dismissible_length;
			$dismissible_length = strtotime( absint( $dismissible_length ) . ' days' );
		}
		check_ajax_referer( 'dismissible-notice', 'nonce' );
		self::set_admin_notice_cache( $option_name, $dismissible_length );
		wp_die();
	}
public static function dismiss_admin_notice ( ) { $ option_name = isset ( $ _POST [ 'option_name' ] ) ? sanitize_text_field ( wp_unslash ( $ _POST [ 'option_name' ] ) ) : false ; $ dismissible_length = isset ( $ _POST [ 'dismissible_length' ] ) ? sanitize_text_field ( wp_unslash ( $ _POST [ 'dismissible_length' ] ) ) : 1 ; if ( 'forever' !== $ dismissible_length ) { $ dismissible_length = ( 0 === absint ( $ dismissible_length ) ) ? 1 : $ dismissible_length ; $ dismissible_length = strtotime ( absint ( $ dismissible_length ) . ' days' ) ; } check_ajax_referer ( 'dismissible-notice' , 'nonce' ) ; self :: set_admin_notice_cache ( $ option_name , $ dismissible_length ) ; wp_die ( ) ; }
Handles Ajax request to persist notices dismissal.
Handles Ajax request to persist notices dismissal .
// If $dismissible_length is not an integer default to 1.