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
- Custom media upload content for inserting custom post shortcode
- Checking if an attribute exists in a shortcode
- All shortcodes not working on custom theme
- enqueue script only if it is not already enqueue
- Shortcode output appears before post body [duplicate]
- Using nextGen Gallery.. how can I call a list of all Gallery Names?
- Two embedded gallery in one post
- How to parse nested shortcodes?
- How to call shortcode function directly and pass $atts
- change plugin shortcode function [closed]
- Dynamic HTML not displaying at respective place
- How to get all attachment image from post ?? WordPress
- Plugin form unable to process
- Short code for Venues
- Frontend editing, Frontend user dashboard
- NextGen Gallery – automatically create gallery sub page?
- Can’t get custom posts of taxonomy to show
- How do I create a full-bleed background image on text mouseover? [closed]
- Get a list of galleries from an album in NextGEN Gallery [closed]
- Shortcode doesn’t work if I directly paste its function in a template file?
- Pass variable to nested shortcode
- Add custom variable in Contact Form 7 mail body
- get shortcode value
- Gallery plugin forces itself above text
- How to generate CSS from a shortcode within a plugin
- Storing Options in a Shortcode
- Image gallery plugin [closed]
- Prevent shortcode from being wrapped in tags
- How to remove html code in excel downloads using phpspreadsheet with wordpress plugins shortcode
- Plugin Handle URL With Custom Theme
- Howto accurately position images with maximum flexibility?
- How to put JQuery/Ajax inside shortcode?
- Snippets: is it better to add them in functions.php or make site-specific plugins?
- Can someone please tell me what is wrong with my plugin?
- Trouble with editing template for “List category posts” plugin
- WordPress function not being called from jQuery method
- AddToAny shortcode in the loop
- How to fix wrong attribute error for Visual Composer Grid Builder?
- Shortcode Plugin to dynamically build a shortcode via `do_shortcode` not working
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- Image Manager Plugin [closed]
- Inject HTML meta tag inside wordpress tag using add_shortcode
- Use $_GET inside a shortcode print empty Array
- My plugin won’t return anything [closed]
- Render Modula Plugin Shortcode On Ajax Request
- Shortcode to update user meta
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- Deactivate JS Script in Plugin Shortcode
- Shortcode not working after move wordpress website files
- Shortcode not getting replaced
- what is name of this plugin used for photo gallery page [closed]
- Best portfolio/gallery/carousel slideshow plugin with thickbox? [closed]
- Plugin that provides the [edit] shortcode?
- Return multiple values in a shortcode attribute
- Shortcode Attributes to Return different $_POST
- How to change shortcode’s default theme?
- Override/ignore CSS from active theme as not to interfere with my custom CSS
- Is there a way to convert shortcodes to html content?
- How to get images using taxonomy ( WP Media Folder)
- Get param from shortcode in plugin function
- Loop returns the current page’s permalink and guid instead of the post in the loop
- Inserting shortcode in href – any ideas or workarounds?
- Load CSS files in header of Bones theme?
- Elementor Pro display featured image on section -> style -> image using shortcode
- Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
- Shortcode show error while editing post
- Get Shortcode output to database for static post_content
- Issue Saving Posts That Contain Shortcode
- Using Shortcode Result In Custom HTML Block (Using Google Sheet JQuery Result As NumScroller data-max)
- How to use plugin’s shortcode in custom design? [closed]
- WP Plugin CSS not being applied to page
- How to add HTML to a template only when user is logged out/ not registered
- Multiple calling javascript from shortcode in one page
- How to pass value to a plugins shortcode?
- Is it possible to get a shortcode generated by a plugin, then, using a function, create a new post using that shortcode?
- Find all strings between an enclosing shortcode
- Hide some shortcodes on posts from back-end
- Trouble implementing python on WordPress
- Get url of selected gallery images?
- Is there a function to search for a wildcard value when calling a shortcode?
- How to display single arbitrary facebook post with a shortcode?
- Multiple level shortcodes
- how to open image gallery in a post/page?
- Custom shortcode with dynamic rewrite
- apply_filters to content but ignore shortcodes
- Multiple thumbnails and one gallery
- How to load a plugin when doing an Ajax call? [duplicate]
- Is it right way to create shortcode?
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- Creating Features List in WordPress Post
- Continuous jQuery Slider / Carousel Plugin with linkable slides [for WooCommerce]
- I am experiencing difficulty fulfilling client request
- How to show image caption in Woocommerce gallery
- cURL External API request displays content above other content on page
- Beginner question: Accessing js script in plugin
- thumbnail_width not working in wordpress most popular post plugin
- Display file contents within Plugin