Problem with custom shortcodes in 1.8.0
-
I came with something new regarding my previous topic. I’ve tried to just reply to that topic but the reply refused to show up so I’ve just marked it as resolved and I am creating a new topic instead. Sorry for that.
So I did more testing and it seems like the problem lies somewhere else. “dynamic => true” seems to be working after all in 1.8.0 and the element is inserted as a shortcode (as it should). However, when I insert the element, save the page and reload the Tailor (or close and open it again, it does not matter), I do not see the element on the front-end, instead I see an error message:
"The element associated with shortcode <strong>tailor_name_of_my_shortcode</strong> could not be found".
Notice the prefix – “tailor_”. However shortcode’s correct tag is just name_of_my_shortcode, without “tailor_” prefix. So it seems like Tailor is for some reason prefixing “tailor_” when calling a shortcode in the Front-end editor. Again, it worked in the previous version (1.7.10).
I’ve tracked the issue into “includes/class-models.php” file. Line 938 in generate_models_from_html function:
'tag' => 'tailor_' . $type,
When I remove ‘tailor_’, it fixes my shortcodes, but breaks default Tailor shortcodes. So we need to fix this function to not to hardcode “tailor_” prefix for every shortcode tag.
- The topic ‘Problem with custom shortcodes in 1.8.0’ is closed to new replies.