Shortcode in function not working for me after 4.17.0 update
- This topic has 8 replies, 2 voices, and was last updated 6 years, 6 months ago by
Brian.
-
AuthorPosts
-
March 31, 2019 at 8:58 AM #13993
Brian
ParticipantHi -
Since the most recent update of Meta Box 4.17.0 - my do_shortcode function has stopped working / not displaying. This is what I currently have in my functions.php file:https://ghostbin.com/paste/rnqqu/raw
What do I need to change for it to continue working as before?
Thanks in advance!
April 1, 2019 at 10:10 AM #13997Anh Tran
KeymasterHi Brian,
I've just tested the code and it works fine to me. I modified the code a little bit to work for my test (as I don't have your hook, I use
the_content, everything else is the same):https://ghostbin.com/paste/fn24m
Here is my screenshots:
https://screenshots.firefox.com/iwwS8S5VJn85bYN6/localhost
https://screenshots.firefox.com/3coKCuQPHAxCyH00/localhostApril 1, 2019 at 10:31 PM #14012Brian
ParticipantHi Anh,
Thanks for the reply. It's still is not working for me on my end. I'll try to explain better.It seems that the shortcodes are getting stripped out. When I change
do_shortcode('[rwmb_meta id="tour_duration"]')toesc_html( $duration )then my values display correctly again. See screenshot: https://cl.ly/2d608aa78e1bWhy would that be the case?
The shortcodes work fine on their own when adding directly to the tour page. But my hook is displaying these values in a grid display ( a custom visual composer post type grid module).
Is there something I need to adjust so that the shortcodes don't get stripped out?
Thanks in advance!
April 2, 2019 at 10:46 AM #14021Anh Tran
KeymasterHi Brian,
If the shortcode works fine on their own somewhere else, then it works.
In this case, the problem might come from how the post type grid module works. I have no idea about this.
Can you try var_dump the value of
do_shortcode('[rwmb_meta id="tour_date"]')in the function, just to see if it returns correct value?April 3, 2019 at 7:27 AM #14040Brian
ParticipantHi Anh,
Thanks for the reply. I'm not familiar with the proper way to use the var_dump. I tried a few things but each time got: null (maybe using it wrong?).Anyway I can tell you that your shortcodes were previously working before in the function. Nothing changed - there was no theme or plugin updates. Only thing that updated was the metabox plugin. That's when it stopped working.
Thanks
April 3, 2019 at 8:26 AM #14041Anh Tran
KeymasterHi Brian, can you send me a temporary admin account to check that? Maybe the problem is somewhere else.
April 19, 2019 at 6:43 AM #14205Brian
ParticipantHi Anh,
Ok I sent you the site info for you to take a look. Let me know what you find.
Thanks!April 19, 2019 at 4:40 PM #14206Anh Tran
KeymasterHi Brian,
Thanks a lot for your info! I've figured it out and fixed on your site. The fix is also added in the plugin.
April 19, 2019 at 11:13 PM #14209Brian
ParticipantHi Anh,
Excellent - thanks for looking into this for me.
Thanks again! -
AuthorPosts
- You must be logged in to reply to this topic.