From 11530233af6e6cdee71b9279ec7bf5a629da8da3 Mon Sep 17 00:00:00 2001 From: Tor Morten Jensen Date: Mon, 22 Feb 2016 13:34:18 +0100 Subject: [PATCH] Adds support for script localization Adds support for WordPress' script localization feature. --- Herbert/Framework/Enqueue.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Herbert/Framework/Enqueue.php b/Herbert/Framework/Enqueue.php index 4602740..160a960 100644 --- a/Herbert/Framework/Enqueue.php +++ b/Herbert/Framework/Enqueue.php @@ -73,6 +73,10 @@ public function buildInclude($attrs, $footer) else { wp_enqueue_script($attrs['as'], $attrs['src'], [], false, $footer); + + if(isset($attrs['localize'])) { + wp_localize_script( $attrs['as'], $attrs['as'], $attrs['localize'] ); + } } }