ninja_forms_render_localize_script_data
The Ninja Forms ninja forms render localize script data hook.
Description
Parameters (1)
- 0. $array — Optional. (callback) =>
array( 'ajaxNonce' => wp_create_nonce( 'ninja_forms_display_nonce' ), 'adminAjax' => admin_url( 'admin-ajax.php' ), 'requireBaseUrl' => Ninja_Forms::$url . 'assets/js/', 'use_merge_tags' => array(), 'opinionated_styles' => Ninja_Forms()->get_setting( 'opinionated_styles' ) )
- The array.
Usage
- To run the hook, copy the example below.
- $array = apply_filters( 'ninja_forms_render_localize_script_data', $array );
- if ( !empty( $array ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the ninja_forms_render_localize_script_data callback
- function filter_ninja_forms_render_localize_script_data( $array ) {
- // make filter magic happen here...
- return $array;
- };
- // add the filter
- add_filter( 'ninja_forms_render_localize_script_data', 'filter_ninja_forms_render_localize_script_data', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'ninja_forms_render_localize_script_data', 'filter_ninja_forms_render_localize_script_data', 10, 1 );
Defined (1)
The filter is defined in the following location(s).
- /includes/Display/Render.php
- $data = apply_filters( 'ninja_forms_render_localize_script_data', array(