• This is a feature request.

    1. Please use the standard wp_enqueue_script and wp_enqueue_style functions to add scripts/styles into head/footer (this would at least give each script a proper $handle e.g. ‘rabbitbuilder-script-ID‘)
    2. Please add the ability to override the $handle in the options … you could even leverage the natural wordpress slug field for this since wordpress would then ensure they were all unique.
    e.g. if item is a script and $slug/$handle is ‘global’, the final handle could be like ‘rabbitbuilder_global’, and in code it would output <script id="rabbitbuilder_global-js" type="text/javascript" ...>

    The reason I’m requesting is that I’d like to use wp_add_inline_script in a code snippet to create some JS variables in PHP like so: https://digwp.com/2019/07/better-inline-script/ (see the 3rd example ‘BEST: inline scripts via wp_add_inline_script()’)

    THANKS!

The topic ‘creating JS variables in PHP for a RabbitBuilder JS external script’ is closed to new replies.