Is there a function that can check if an enqueued script has a call to wp_localize_script attached to it?
1 Answer
Try this:
function is_localized($tag) {
global $wp_scripts;
$data = $wp_scripts->get_data( $tag, 'data' );
return ! empty( $data );
}
-
As I'm facing a related question right now: There's no
l10n
part insideextra
(anymore?). It'sarray( 'data', 'group' );
.– kaiserCommented Aug 2, 2012 at 2:11 -
1