HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/globfdxw/www/wp-content/plugins/kirki/includes/Ajax/Walkthrough.php
<?php
/**
 * Walkthrough or onboarding
 *
 * @package kirki
 */

namespace Kirki\Ajax;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}
use Kirki\HelperFunctions;


/**
 * Walkthrough API Class
 */
class Walkthrough {

	/**
	 * Get walkthrough state
	 *
	 * @return void wp_send_json.
	 */
	public static function get_walkthrough_state() {
			$user_id   = get_current_user_id();
			$user_meta = get_user_meta( $user_id, KIRKI_USER_WALKTHROUGH_SHOWN_META_KEY, true );

		if ( $user_meta ) {
			wp_send_json( true );
		} else {
			wp_send_json( false );
		}

			die();
	}

	/**
	 * Set walkthrough state
	 *
	 * @return void wp_send_json.
	 */
	public static function set_walkthrough_state() {
			//phpcs:ignore WordPress.Security.NonceVerification.Missing,WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
			$walkthrough_state = HelperFunctions::sanitize_text( isset( $_POST['walkthrough-shown-state'] ) ? $_POST['walkthrough-shown-state'] : null );
			$user_id           = get_current_user_id();
			update_user_meta( $user_id, KIRKI_USER_WALKTHROUGH_SHOWN_META_KEY, $walkthrough_state );

			wp_send_json( true );

			die();
	}
}