$type, 'text' => $text, ), MINUTE_IN_SECONDS ); $target = admin_url( 'admin.php?page=' . sanitize_key( $page ) ); $ref = wp_get_referer(); if ( is_string( $ref ) && false !== strpos( $ref, 'page=admintrace-activity-logger' ) ) { $target = $ref; } wp_safe_redirect( $target ); exit; } /** * Print a queued notice. */ public static function render() { $notice = get_transient( self::key() ); if ( ! is_array( $notice ) || empty( $notice['text'] ) ) { return; } delete_transient( self::key() ); $class = 'notice-success'; if ( isset( $notice['type'] ) && 'warning' === $notice['type'] ) { $class = 'notice-warning'; } elseif ( isset( $notice['type'] ) && 'error' === $notice['type'] ) { $class = 'notice-error'; } echo '
' . esc_html( $notice['text'] ) . '