dozent_get_flashdata( string $data = 'message' )

Get the flash data by passing argument, supports (message|type)


Description

Example usage:

$data = dozent_get_flashdata(); // return message
$data = dozent_get_flashdata( 'message' ); // return message
$data = dozent_get_flashdata( 'type' ); // return type

Parameters

$data

(string) (Optional) message|type

Default value: 'message'


Return

(mixed|void)


Source

File: includes/core-functions.php

	function dozent_get_flashdata( $data = 'message' ) {
		$cookie        = ( ! empty( isset( $_COOKIE[ 'dozent_flash' ] ) ) ) ? dozent_sanitize_array( $_COOKIE[ 'dozent_flash' ] ) : [];

		$cookie = (array) $cookie;
		$flash_message = stripslashes( dozent_array_get( 'message', $cookie ) );
		$type          = dozent_array_get( 'type', $cookie );

		$flash_data = $flash_message;
		if ( $data === 'type' ) {
			$flash_data = $type;
		}

		return apply_filters( 'dozent_get_flashdata', $flash_data, $flash_message, $type );
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.