Hi @oli89,
Thanks for using shortcoder.
Regarding the issue, it looks like there is an issue with the parser to identify custom fields.
I’ll work on this issue and let you know on a temp workaround.
Thanks,
Aakash
Thread Starter
oli89
(@oli89)
Hi @vaakash,
thanks very much for your fast answer and your help.
I will be really lucky to hear from you:-)
best regards
Oli
Hi @oli89,
Please go to Plugin editor and select shortcoder –> shortcoder.php
Replace line number 277
preg_match_all('/\$\$[^\s]+\$\$/', $content, $matches );
with this
preg_match_all('/\$\$[^\s^$]+\$\$/', $content, $matches );
and save the changes. Now it should work.
Please let me know how it goes.
Thanks,
Aakash
Thread Starter
oli89
(@oli89)
Hi @vaakash,
thanks very much for the fast help.
I have try your code and it works, thanks very much.
Sorry but I have found 2 more things, which I am not sure if there working right.
1: I have try to build the link on a better way now. For this I use the “attached” mode of on the ACF Single text box, so I can copy the link in the text box and the tracking-id will added automatically. But in the shortcoder I get only the things from the textbox without the added tracking-id. Is there maybe also a misstake?
2: I have in the ACF now one field to select the shop, depending to the selected shop there is a rule how show only the textbox with the correct tracking-id of the selected shop on my page-site. In case that the shortcoder have to work with the selected shop I add now all the ACF (one after the other) in my link. My hopping was, that the shortcoder only use the ACF, which are currently available (in case of the rule) on my page, but the plugin work also with the not available ACF and add them to the code. Is this the way it should work, or can you maybe also take a look to this function?
I will be really happy to hear from you again
Best regards
Oli
Thread Starter
oli89
(@oli89)
Hi @vaakash,
how are you? hope fine!
Do you received my message?
Best regards
Oli
Hi @oli89,
Sorry I missed your reply. Regarding your query with custom fields, I did not completely understand your setup as I have not worked extensively with ACF.
But one thing I can tell is that shortcoder does not understand how ACF works or how ACF saves it’s data.
To explain how this works, WordPress by default provides “custom fields” which you can see below the editor. Shortcoder will simply take that value for the field name you have provided.
https://i.snipboard.io/7vo83N.jpg
ACF just provides a rich way to work with custom fields.
Shortcoder does not use any of ACF’s API to understand it.
It will simply get the value for the custom field name you have provided.
Please note that, this feature is just a basic and quick way to change shortcode content based on custom field value.
If shortcoder is not functioning as mentioned above or if you would like to share a generic idea to enhance this feature please let me know.
Thanks,
Aakash