[Résolu] Using types shortcode to provide a value to another shortcode – not working
This support ticket is created Il y a 2 années et 5 mois. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
My shortcode [acur_from_time] outputs a date when given a time in seconds.
The first line is to show that it works correctly
The second line is how I want to use it, with the time coming from a custom field.
The third line is to show that the custom field does contain a sensible value.
This image shows what appears within the block editor: it seems to be OK.
hidden link
This image shows what appears on the front end: the [types] shortcode isn't being recognised.
hidden link
(This is the key faulty output:
With Shortcode – wprss_item_date: 01 Jan 1970[/types]]
)
I've used this construct before and have run out of ideas of what to test...
Thank you for contacting us and I'd be happy to assist.
Can you please make sure that the custom shortcode "acur_date_from_time" has been added in the "Third-party shortcode arguments" section, at WP Admin -> Toolset -> Settings -> Front-end Content?
I'd tried registering the shortcode as a third-party argument, even though it wasn't being used to provide an argument. I registered it again anyway just now. I also tried using wpv-post-field instead of the types shortcode. All with no effect.
This is what I get
hidden link
(The field wprss-item-date is provided by another plugin, but I've set it to be "Managed with Types" in the Post Field Control section)
And just now, I deactivated all plugins except Toolset Types, Toolset Blocks and the WP RSS Aggregator plugins - still with no impact (and I cleared caching as well!)
Thank you for waiting and I apologize for the delay in getting back on this.
During testing on your staging website, I noticed that the issue is only happening when used inside a reusable block. The same nested shortcode works correctly, if it is directly added to the content template, without a reusable block.
Based on this the following updated code for the custom shortcode, works on my test website, even from inside a reusable block: