Hi @theschappy,
Thanks, good to hear 🙂
At this moment, there’s no filter, but I’ve taken a look and I think it should work by wrapping each string field into a do_shortcode() function. I’ve added this on a git branch.
I’ve also added a filter to use. Can you try if this works for you? I’ve added it on github:
https://github.com/rlankhorst/zip-recipes-free/tree/execute-shortcodes-in-text-fields
As the node_modules folder is very big, and only needed for compiling gutenberg, you can delete it before uploading.
If this works for you I’ll publish it in the next update.
Hi Rogier,
Thanks for creating the brach so quickly. It works partially wide a minor side effect. Once you click on the save button in the backend, the shortcode will be evaluated and gots replaced by the actual content also in the form and stored as html code in the database. The do_shortcode function should only be executed for content to be displaying in the frontend
Thus, I would remove it from load function of models/Recipe.php. I discovered there is the filter zrdn_field_value called for all values loaded from the database, would be great to have approach for values to be displayed in the frontend. For example, applying a filter on the ready-to-render content after getting the content from calling Util::view(‘recipe’, $viewParams) at the end of function zrdn_format_recipe in class.ziprecipes.php.
Cheers,
Matthieu
Yes, you’re right of course. I have moved it to the zrdn_format_recipe function, and added another filter there as well. This should execute any shortcodes, and offers the option to use the filter “zrdn_recipe_content”
Let me know if this helps! (same git branche)