Bug – wp_localize_script
-
Does not match the data type, the second argument wp_localize_script:
$sh_settings = array_merge( array( 'unsaved_changes_txt' => __('Some changes have not been saved.', 'syntax-highlight') ), $sh_settings); wp_localize_script( $this->js_handle, 'shSettings', $sh_settings);
Fix:
if(is_array($sh_settings)) { $sh_settings = array_merge(array( 'unsaved_changes_txt' => __('Some changes have not been saved.', 'syntax-highlight') ), $sh_settings); }else{ $sh_settings= array(); }
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Bug – wp_localize_script’ is closed to new replies.