I cannot comment, I would if I could, but I can’t, please don’t down-vote
Could you not just use 1 shortcode with a parameter, e.g. instead of create one for each gallery image-gallery-1
,image-gallery-2
etc, you could just use the ID as a parameter: image-gallery 1
, image-gallery 2
…
Then in your handling function you can simply test the parameter to see which gallery it is, I think this method is also slightly better for performance too as you don’t need to call add_shortcode
as many times, and all you are doing is removing one hyphen 🙂
Related Posts:
- How to customise the output of the WP image gallery shortcode from a plugin?
- Calling function from within functions.php returns unwanted value
- WordPress show descriptions under images in gallery
- How to add a shortcode button to the TinyMCE editor?
- How to include code only on specific pages?
- Custom media upload content for inserting custom post shortcode
- Validation error: Extending Gutenberg gallery block
- Checking if an attribute exists in a shortcode
- how to include other plugins css files in a shortcode?
- What characters are allowed as a shortcode tag and how should they be sanitized?
- All shortcodes not working on custom theme
- enqueue script only if it is not already enqueue
- Shortcode output appears before post body [duplicate]
- Autogenerate wordpress shortcodes using array?
- Using nextGen Gallery.. how can I call a list of all Gallery Names?
- PHP Deprecated: Non-static method should not be called statically
- Two embedded gallery in one post
- How to parse nested shortcodes?
- Loading shortcode with ajax
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Adding Custom Fields for Img in Posts
- How to call shortcode function directly and pass $atts
- How To Ignore a Filter On Applying Filter the Content In a Function
- Cannot strip JW Player shortcode?
- Shortcode display outside the div
- How to pass multiple values in shortcode?
- append stylesheet via shortcode
- Shortcode under a Shortcode Multiple times Possible?
- Pass $this to function nested in another public function of the same class
- change plugin shortcode function [closed]
- plugin shortcodes not working on custom theme- unsure how to fix
- How to list all active and specific shortcodes in wordpress
- Dynamic HTML not displaying at respective place
- shortcode doesn’t work
- How to get all attachment image from post ?? WordPress
- Plugin form unable to process
- Calling shortcode in wp_localize_script strips result
- Nested shortcodes
- WordPress shortcodes & performance
- Is it possible to make shortcodes NOT case sensitive?
- Storing image gallery plugin data
- Short code for Venues
- do_shortcode() doesn’t work if shortcode contained in variable, works if shortcode passed as string
- Layout shop page: resize images and columns
- How to add inline css/js inside a shortcode
- How extend shortcode default values for a plugin?
- how to show database content in wordpress post
- wp_specialchars and wp_specialchars_decode in a shortcode plugin
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- Shortcode in AJAX popup
- Frontend editing, Frontend user dashboard
- echo do_shortcode is not working on theme’s template
- problem with nextgen plugin
- NextGen Gallery – automatically create gallery sub page?
- Looking for a solution – slightly convoluted problem
- Can’t get custom posts of taxonomy to show
- Changing image size to full size in Gutenberg’s block gallery
- Plugin shortcode won’t work on a custom template file [closed]
- How do I create a full-bleed background image on text mouseover? [closed]
- Can I use a Shortcode output as an HTML attribute value?
- WP theme with Backbone
- Get a list of galleries from an album in NextGEN Gallery [closed]
- shortcodes displaying outside of content area with echo statement, not what I wanted [duplicate]
- Shortcode doesn’t work if I directly paste its function in a template file?
- Trying to count the total number of paragraphs inside a blog article
- How Can I Pass the Shortcode’s $atts Variable to the Plugin’s Javascript Function
- Adding json as params to shortcode
- How to add a random image to a post from gallery and only show one?
- Plugin for gallery with thumbnails?
- Shortcode is not working in homepage page template (custom front page)
- How do I turn a custom post type into a plugin?
- Can wp_localize_script be used within a shortcode?
- Shortcode to generate and save password in a file
- Force [wordpress_social_login] shortcode to display where it is embedded [closed]
- Overriding Attributes values in Shortcode Plugins
- May i Use ShortCode in Template?
- Pass variable to nested shortcode
- Add custom variable in Contact Form 7 mail body
- Demystifying and understanding shortcode nomenclature
- How to modify shortcode attributes with data from current post
- get shortcode value
- Confused about shortcode and settings values
- Running jquery script after shortcode [closed]
- Gallery plugin forces itself above text
- How to generate CSS from a shortcode within a plugin
- Add htmlentities and/or shortcode into data-attributes
- Storing Options in a Shortcode
- Custom CSS for plugin form
- Any Short code Availble for Get Post List With Thumbnail Plugin?
- Image gallery plugin [closed]
- Where to call add_shortcode function in WordPress Plugin Boilerplate?
- Show history of post revisions on front end
- Prevent shortcode from being wrapped in tags
- How to remove html code in excel downloads using phpspreadsheet with wordpress plugins shortcode
- Plugin echos text from shortcode function in gutenberg page editor
- Shortcode based chart plugin
- Plugin shortcodes not working in custom theme
- tag breaks shortcode output (other solutions don’t work)
- Input with spaces in Shortcode attributes overwritten by defaults
- How can I create a custom shortcode that will return a custom post type by ID?