Home › Forums › Calendar Products › Events Calendar PRO › tribe_get_option method not working correctly, event comments are not showing
- This topic has 6 replies, 4 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
November 29, 2013 at 5:48 am #79274
John
ParticipantThe method tribe_get_option is returning a boolean value. The method definitions take a default value to return if input value option is not found.
So in default single-event template where conditional check for comments display:
get_option is returning false, not even ‘no’. I have set to show comments in event options so bug is two fold in that it does not return the correct options and also it does not return the default value in method.
December 2, 2013 at 8:42 am #79572Barry
MemberHi John.
It looks like you might have shared some code to help illustrate the problem, which is great … unfortunately the forum currently does a poor job of handling any code that’s been added to replies.
If you did indeed include a short snippet can I ask you to post again but share it via Pastebin, Gist or a similar service?
Thanks!
December 2, 2013 at 10:09 am #79694John
ParticipantHi Barry,
I pasted a little bit of code but all it was showing was the method and its use in single-event template file. It is how the product ships nothing custom, line 82 I think, conditional statement to show comments:
tribe_get_option( ‘showComments’,’no’ ) == ‘yes’
As said this method is returning a boolean value, but should return input string param if option not found, as documentation states. Also I have set to show comments so I am obviously hoping it returns ‘yes’! Could be 2 separate problems, I don’t know if they are related.
December 3, 2013 at 2:51 pm #79979Barry
MemberThanks John: a bug in the template, certainly – that particular setting is stored as a boolean value and if you have enabled the Show Comments setting it ought to return a boolean value of true. The circumstances in which it might return ‘no’ are very limited indeed and we’ll certainly correct this.
In the meantime, you could safely override that template (following the instructions in our Themer’s Guide) and change that particular line to:
<?php if( get_post_type() == TribeEvents::POSTTYPE && tribe_get_option( 'showComments', false ) ) { comments_template(); } ?>Does that help at all? We will of course strive to get this fixed in one of our next maintenance releases.
December 17, 2013 at 3:43 pm #82408Leah
MemberHi there,
I just wanted to pop in here with a quick update. Although we were not able to get a fix for this into our imminent 3.3 release, it is still on the radar for inclusion in a future build. Thanks for your patience!
~Leah
January 21, 2014 at 2:47 pm #95332Leah
MemberHi there,
I’m happy to report that we have fixed this in our upcoming version 3.4. Keep an eye on your Plugins page for an update message! Thanks for your patience while we worked on this.
Best,
LeahJuly 7, 2015 at 6:30 am #982956Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘tribe_get_option method not working correctly, event comments are not showing’ is closed to new replies.
