Filter: um_admin_forms_data_localize

apply_filters( 'um_admin_forms_data_localize', $forms_data ) → {array}

Filters data array for localize wp-admin forms scripts.

Parameters:
Name Type Description
$forms_data array

Data to localize.

Since:
  • 2.8.0
Source:
Returns:

Data to localize.

Type
array
Example

Add `my_custom_variable` to wp-admin forms scripts to be callable via `um_forms_data.my_custom_variable` in JS.

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