Home › Forums › Calendar Products › Events Calendar PRO › Events List Widget
- This topic has 6 replies, 4 voices, and was last updated 11 years, 10 months ago by
Brook.
-
AuthorPosts
-
February 14, 2014 at 9:16 pm #104887
wpsitter
ParticipantNotice that this bug was reported previously and topic closed, but not resolved.
The “view all events in category” does not just show the category-specified events but all categories. Is there a way to stop this link appearing until you have worked out the bug?February 17, 2014 at 2:50 pm #105517Brook
ParticipantHowdy wpsitter,
There are two ways of doing this.
Since you will probably not need to make this change after the next plugin update, you could directly modify the offending code. It can be found here, within widget-list.class.php. Simply replace those lines with
_e( 'View All Events', 'tribe-events-calendar' );That will remove any references to “Events in category”, and thus make the link function like it used to. Ordinarily direct edits like this are a bad idea, but when they are a hack for correcting a bug generally they are the best solution.Or you could simply hide the text in category text with a snippet in your theme’s functions.php. This is not super clean, but you could effectively hide the link with this snippet, by changing
$text = 'my custom text';to$text = '';Would that work for you? Please let me know. Thanks!
– Brook
March 18, 2014 at 10:07 am #120668Sean
ParticipantAny word on the permanent fix for this? I just had our volunteer coordinator relay complaints re: this bug. I could hardcode the link, but I have several other widgets pointing to different calendars. Thanks,
Sean
March 18, 2014 at 10:22 am #120682Brook
ParticipantHowdy Sean,
No fix yet. 🙁 We have had a lot of higher priority items and some really exciting updates coming in 3.5 though. It is a very exciting release. However, it looks like it will be a bit longer before this particular bug is fixed.
For now the snippet I posted makes a pretty good fix. If you modify the $text var to
$text = 'View All Events';It functions the same it as it always has. Once the bug is patched you can just remove that snippet from your functions.php.– Brook
May 27, 2014 at 6:17 am #180831timwakeling
ParticipantHi Brook – I’ve fixed this bug for you! To make this link go to the right category URL, just add the following at line 126 of widget-list.class.php, i.e. just before the comment /* Display link to all events */:
$cat = get_term( $category, 'tribe_events_cat' );
$event_url = get_term_link( $cat );
I have also modified line 131 to read:
_e( 'View all ' . $cat->name . ' events', 'tribe-events-calendar' );
But that’s optional, of course.
Hope that helps!
Tim
May 28, 2014 at 6:57 am #183821timwakeling
ParticipantUpdate: the above code actually causes an error on pages whose links are NOT category specific, because it doesn’t handle WP_Error correctly. Here’s what I think the code should now be:
if ( $category ) {
$cat = get_term( $category, 'tribe_events_cat' );
if ( !is_wp_error( $cat ) ) $event_url = get_term_link( $cat );
}May 28, 2014 at 8:05 am #183966Brook
ParticipantThank you timwakeling! That is very excellent of you. Now other folks can implement your fix immediately if they need.
This was actually fixed in our forthcoming release, then an improvement that allows you to select multiple categories for the widget rendered the change moot as we redid all of our wording. Our next release is due shortly, I hope you all enjoy the new features and improvement to our wording.
– Brook
-
AuthorPosts
- The topic ‘Events List Widget’ is closed to new replies.
