Add `wp_localize_script` to the file, not inline
-
Hi everyone.
Would you please help me with the following issue.
I have got a really big volume of data that I need to pass from php to javascript.
I usewp_localize_script( 'my-scripts', 'myOptions', $context['options'] );
to pass this data and that data passes to the page as inline code
`<script type=’text/javascript’>
/* <![CDATA[ */—- THE ARRAY IS HERE—-
/* ]]> */
</script>
Is there a way to pass this data into the file, not inline?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Add `wp_localize_script` to the file, not inline’ is closed to new replies.