Flash
class Flash (View source)
Provide a way to flash data into the session for the next request.
Constants
CURRENT_KEY |
Keys for different request contexts. |
NEXT_KEY |
|
Methods
Get the store for flash messages.
Get whether the flash service is enabled.
Add values for a key for the next request.
Add values for a key for the current request.
Get the entire store or the values for a key for the current request.
Get the entire store or the values for a key for the next request.
Clear the entire store or the values for a key for the current request.
Clear the entire store or the values for a key for the next request.
Shift current store and replace it with next store.
Save flashed data to store.
Details
at line 55
__construct(array|ArrayAccess $store, string $store_key = '__wpemergeFlash')
Constructor.
at line 89
array|ArrayAccess
getStore()
Get the store for flash messages.
at line 99
void
setStore(array|ArrayAccess $store)
Set the store for flash messages.
at line 121
boolean
enabled()
Get whether the flash service is enabled.
at line 182
void
add(string $key, mixed $new_items)
Add values for a key for the next request.
at line 193
void
addNow(string $key, mixed $new_items)
Add values for a key for the current request.
at line 204
mixed
get(string|null $key = null, mixed $default = [])
Get the entire store or the values for a key for the current request.
at line 215
mixed
getNext(string|null $key = null, mixed $default = [])
Get the entire store or the values for a key for the next request.
at line 225
void
clear(string|null $key = null)
Clear the entire store or the values for a key for the current request.
at line 235
void
clearNext(string|null $key = null)
Clear the entire store or the values for a key for the next request.
at line 244
void
shift()
Shift current store and replace it with next store.
at line 256
void
save()
Save flashed data to store.