You’re using it twice differently, but you’re not creating a unique transient name, so the second time the shortcode runs it just uses whatever was saved in the transient the first time the shortcode ran.
Come up with some way to uniquely identify the transient, like:
set_transient( 'shortcode_post_' . sanitize_key( $a['name'] ), $shortcode_post, 60*60*4 );
That said, I don’t know that there’s really much advantage to saving that result to a transient at all.
Related Posts:
- Conditionally Loading JavaScript/CSS for Shortcodes
- Show shortcode without executing it
- shortcodes output before content [duplicate]
- Run visual composer code in php page
- WordPress adds br in between my shortcode
- Shortcodes, HTML tables, and multiple rows
- Audio or playlist shortcode condition according to the amount of files on attachment page
- Does a shortcode with a single attribute have to use an array?
- 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
- Post loop created via shortcode not displaying shortcode in content
- Pass shortcode variables to template
- passing multiple parents value into a shortcode
- Is it possible to add a repeater field to TinyMCE’s option window?
- Shortcodes: Pros and Cons
- esc_attr not working in shortcode
- Raw output (preventing wpautop)
- Conditionally loading Facebook PHP SDK in shortcode
- Can’t understand $atts in functions?
- Are .MP3 files with capital letter extensions allowed in [audio] shortcode?
- How to handle shortcodes when using the JSON API
- Are shortcode functions applied while rendering the content, or are they executed and stored with the post content?
- is_admin() returns false in save_post hook with Gutenberg editor
- How to parse this shortcode?
- Get Posts shortcode plugin and meta_query?
- possibility to control embedded video timeline with buttons and links external to the player
- WordPress Gallery shortcode: Display one category ID only
- WordPress Shortcode show database row
- Creating shortcode with parameter
- Video Shortcodes not working in WordPress
- Custom shortcode is not working in text widget
- Create shortcode in Child Theme?
- Get post object in shortcode function
- How to insert image and text from admin panel throughout my theme
- Use shortcodes in terms description? [closed]
- Adding to the_content or a variable from within a shortcode function
- How to add shortcode to HTML file (not showing on website)
- Custom Shortcode: define cursor position/insertion point?
- Shortcode: text content ends up outside html tags
- show shortcodes in editor
- Page code showing in WP Dashboard
- echo do_shortcode just prints the shortcode name and not its content
- Insert shortcode between ”
- Create a shortcode to use in visual editor
- Basic do shortcodes question
- What is this format called (nested shortcodes)?
- Problem with height in video shortcode
- How to build dynamic pages?
- Shortcode not showing $content in correct place
- Best tools for preparing and styling a table [closed]
- How to reload the shortcode content when the database is changing
- Best way to include reusable sections in page content
- Custom shortcode to display posts, first post is full
- Beginner’s question about shortcodes
- How can I insert a shortcode in the title tag of another?
- How to execute a shortcode outside the post content/entry in a theme?
- Metabox Keeps Stripping Parts of Shortcode
- Shortcode from admin textarea to page
- Form processing: How to process form before output and access data from shortcode
- How to Retrieve data of Gallery Shortcode and display it above a post
- Checking post content for a shortcode, but content is being returned as empty
- Replace shortcode with output in database?
- Wrap php in shortcode
- Adding my own custom woocommerce shortcode to child theme, how?
- contact form 7 :create shortcode usable in email message [closed]
- Shortcode, Concatenating & Parse error: syntax error, unexpected T_FOREACH
- Better way to display multiple plugin output on the same page?
- get_queried_object_id / short code returning blank
- Shortcode won’t take into account custom post ID put in parameter
- Colon is Missing In My Website Url in WordPress Shortcode
- How to utilise multiple values from a single shortcode attribute?
- JavaScript missing from shortcode content
- Multiple shortcodes with embedded JavaScript code in same page, how?
- Contact Form 7 shortcode is commented out, but I receive spam emails from it
- wp_link_pages shortcode for ‘nextpagelink’
- WordPress keeps automatically inserts
- Function in a wordpress shortcode
- nested shortcodes from different plugins. too complex? [duplicate]
- Use Shortcode on Custom Page
- WordPress Database Error using $wpdb->get_results()
- How to make shortcode enabled in JSON Feeds?
- How to add a shortcode to an HTML image tag
- Shortcode or Template Page
- Why can’t I type [ ] opening and closing brackets on the Visual tab?
- Shortcode for External HTML
- How to implement theme shortcodes in text outside of pages?
- Manipulated shortcode output
- Where is escaped the shortcode?
- Str_replace using shortcode with multiple changes
- Changing layout of defaul gallery output to masonry
- shortcode change variable base on user
- Inserting shortcode is blanking excerpt – any ideas?
- Previous/Next with the same category
- 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
- How to use multiple values in “Shortcode”? [closed]