Filter: um_admin_enqueue_localize_data

apply_filters( 'um_admin_enqueue_localize_data', $variables ) → {array}

Filters data array for localize wp-admin global scripts.

Parameters:
Name Type Description
$variables array

Data to localize.

Since:
  • 2.0.0
Source:
Returns:

Data to localize.

Type
array
Example

Add `my_custom_variable` to wp-admin global scripts to be callable via `um_admin_scripts.my_custom_variable` in JS.

function um_custom_admin_enqueue_localize_data( $variables ) {
    $variables['{my_custom_variable}'] = '{my_custom_variable_value}';
    return $variables;
}
add_filter( 'um_admin_enqueue_localize_data', 'um_custom_admin_enqueue_localize_data' );