/** * Localize for js files */ public static function ig_localize() { IG_Init_Assets::localize('ig-pb-handleelement', 'Ig_Translate', IG_Pb_Helper_Functions::js_translation()); IG_Init_Assets::localize('ig-pb-handleelement', 'Ig_Js_Html', IG_Pb_Helper_Shortcode::$item_html_template); IG_Init_Assets::localize('ig-pb-handleelement', 'Ig_Ajax', IG_Pb_Helper_Functions::localize_js()); // Localize scripts for premade layout modal. IG_Init_Assets::localize('ig-pb-premade-pages', 'Ig_Translate', IG_Pb_Helper_Functions::js_translation()); IG_Init_Assets::localize('ig-pb-premade-pages', 'Ig_Ajax', IG_Pb_Helper_Functions::localize_js()); IG_Init_Assets::localize('ig-pb-layout', 'Ig_Translate', IG_Pb_Helper_Functions::js_translation()); IG_Init_Assets::localize('ig-pb-widget', 'Ig_Preview_Html', IG_Pb_Helper_Functions::get_element_item_html(array('element_wrapper' => 'div', 'modal_title' => '', 'element_type' => 'data-el-type="element"', 'name' => 'Widget Element Setting', 'shortcode' => 'IG_SHORTCODE_CONTENT', 'shortcode_data' => 'IG_SHORTCODE_DATA', 'content_class' => 'ig-pb-element', 'content' => 'Widget Element Setting'))); }
/** * Do 'admin_footer' / 'wp_footer' action. * * @return void */ public static function footer() { self::print_inline('js'); // Indicate that the hook is triggered self::$triggered_hooks[] = 'footer'; // Apply filter to prepare script localization self::$localize = apply_filters('ig_localize_assets', self::$localize); // Localize scripts if (is_array(self::$localize)) { foreach (self::$localize as $handle => $localization) { if (count($localization)) { foreach ($localization as $localize) { // Prepare arguments array_unshift($localize, preg_replace('/-(css|js)$/', '', $handle)); // Let WordPress localize this script call_user_func_array('wp_localize_script', $localize); } } } } }
/** * Localize Script */ public function ig_localize() { IG_Init_Assets::localize('ig-pb-handlesetting-js', 'Ig_Ajax', IG_Pb_Helper_Functions::localize_js()); }