each time you call the shortcode function, you overwrite the previous script var with the current version. make it an array instead of a string:
self::$var[] = $script;
and then output with foreach:
public static function footer()
{
foreach( self::$var as $script ){
echo $script;
}
}
Related Posts:
- current_shortcode() – detect currently used shortcode
- Shortcode function executed twice?
- Replacement for gallery_shortcode function not taking all attributes
- JavaScript missing from shortcode content
- Ajax callback and shortcode functionality
- How to create a shortcode with 1 parameter (atts)
- shortcodes output before content [duplicate]
- WordPress adds br in between my shortcode
- Shortcodes, HTML tables, and multiple rows
- WP_enqueue_script inside shortcode?
- Shortcode to Gutenberg-block: additional text on front-end and conditional display
- How navigation works in custom loop within shortcode?
- Use [shortcode=”value”] instead of [shortcode att=”value”]?
- I dont want to show shortcode in tag
- How do I preview the result of a shortcode in the TinyMCE editor?
- Shortcodes: Pros and Cons
- WordPress shortcode doesn’t working on HomePage
- Can’t understand $atts in functions?
- Are .MP3 files with capital letter extensions allowed in [audio] shortcode?
- Add attribute to shortcode dynamically
- Execute shortcode twice in the same page
- How to parse this shortcode?
- Add custom setting that uses radio button to WP Gallery
- Shortcode with hyphen doesn’t work
- Shortcode parsed incorrectly because of heredoc
- Shortcode “post_per_page” not working
- Shortcode is running in page editor
- Creating shortcode with parameter
- Video Shortcodes not working in WordPress
- Shortcodes won’t work on live environment
- Create shortcode in Child Theme?
- Get post object in shortcode function
- How to insert image and text from admin panel throughout my theme
- Create a short code to display a specific loop
- Use shortcodes in terms description? [closed]
- How to add shortcode to HTML file (not showing on website)
- Custom Shortcode: define cursor position/insertion point?
- My shortcode does not call the function
- Shortcode not showing anything
- Hide Selection of Text From Archive, but Show on Single Posts
- How to create an incremental list using shortcodes?
- Do shortcode that is inserted in a textarea is not displaying properly
- How to Make Archive ShortCode
- Adding custom form within add_shortcode
- Are Shortcode Attributes Always Passed As Strings?
- wp_editor not rendering the shortcode
- Default WordPress shortcodes not working?
- how to add shortcode in wordpress container [duplicate]
- How to make this shortcode work for post content wordpress [duplicate]
- Pass fileurl parameter into shortcode from Advanced Custom Fields
- stop WordPress removing shortcode from content [closed]
- caption shortcode using image alt as caption
- Sanitize or treatment of string in editor via shortcode
- Is it possible to handle two or more shortcodes in a single page?
- Toggle Shortcode Sanitize Title
- Clearfix Shortcode
- How and when to include shortcode source files
- Use full size images in a specific gallery
- how to create a fav icon shortcode?
- How to deal with WordPress bug: can’t use wrapped and unwrapped shortcode on same post
- Execute Shortcodes when submitting post
- Substituting value via shortcode
- Create shortcode for each form field in contact form 7
- Can’t render shortcode when html tag contains hyphen
- Auto embeds don’t work for attachment descriptions
- Shortcode to appear and show the date not code in Title and description of Social Media sites
- Not to escape a text
- how to add shortcode widget at end of main blog page
- Shortcode result appears above page content
- Shortcode is not showing content when placed in editor (post_type = page)
- How to set up posts per page on WP
- How to insert a short code into Contact Form 7 in WordPress that will call a function once the submit button is pressed
- How to Call Related Post based on Categories Inside Post Content with Shortcode?
- Unable to make shortcode, what is wrong?
- Multiple shortcodes only use attributes from one of the shortcodes on custom plugin
- Cannot modify class property from shortcode handler function
- How do i remove Business feeds Shortcode fatal error
- Can’t place endwhile in the loop properly in a shortcode
- How to reduce the image size inside an icon? [closed]
- How to insert visual compser post grid shortcode in a custom page template? [closed]
- Push Shortcode parameter to template
- latest posts shortcode with image
- Shortcode tags appear on mobile themes
- Featured image with link to post shortcode, image displaying above the post
- Video shortcode inside tabs shorcode NOT working
- Manipulated shortcode output
- How to stop unwanted splits in excerpts when using shortcodes for sliders or players
- How to add meta slider lite or other slider to main page header in pinboard theme
- Str_replace using shortcode with multiple changes
- Changing layout of defaul gallery output to masonry
- Escaping a shortcode so it displays as-is [duplicate]
- WordPress do_shortcode first iteration
- Add a short code to a plugin
- Applying if (get_post_meta) to new shortcode
- Add widget/shortcode to sidebar OUTSIDE of the theme
- How to remove https:// from shortcode generated url
- How to enable on custom shortcodes
- Nested ShortCode works inside the_content, but not outside of it
- Why does my shortcode query not working with search term
- How to use multiple values in “Shortcode”? [closed]