Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions classes/helpers/FrmAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ class FrmAppHelper {
*/
private static $included_svg = false;

/**
* @var array Keys are locations and values are true or false.
*/
private static $localized_script_locations = array();

/**
* @since 1.07.02
*
Expand Down Expand Up @@ -3324,6 +3329,10 @@ public static function load_font_style() {
* @return void
*/
public static function localize_script( $location ) {
if ( ! empty( self::$localized_script_locations[ $location ] ) ) {
return;
}

global $wp_scripts, $wp_version;

$script_strings = array(
Expand Down Expand Up @@ -3427,6 +3436,8 @@ public static function localize_script( $location ) {
wp_localize_script( 'formidable_admin', 'frm_admin_js', $admin_script_strings );
}
}//end if

self::$localized_script_locations[ $location ] = true;
}

/**
Expand Down