applyFilters( "get_data" )

applyFilters( "get_data", retVal, key);
applyFilters( "get_data_{key}", retVal, key);
# short
Filters a value that was just read from a Cookie or the localStorage

Filters a value that was just read from a Cookie or the localStorage. When no value exists (or it expired), the value is set to boolean false.

The dynamic part of the filter name is the sanitized entry name. See DiviArea.Utils.sanitizeHookName() for details.


(false|string, required) The value that was read from the Cookie or localStorage.
When no Cookie or localStorage entry exists, the value is false. Otherwise it is a string representing the actual value.
(string, required) The un-sanitized variable name.


// Example 1: Return the string "no" instead of all boolean false values.
DiviArea.addFilter( 'get_data', function( value, key ) {
    if ( false === value ) {
        value = 'no';
    return value;
// Example 2: Output all local data to the console.
DiviArea.addFilter( 'get_data', function( value, key ) {
    console.log('Local variable', key, 'has value', value);
    return value;


Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.