Events List Widget

Home Forums Calendar Products Events Calendar PRO Events List Widget

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #104887
    wpsitter
    Participant

    Notice 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?

    #105517
    Brook
    Participant

    Howdy 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

    #120668
    Sean
    Participant

    Any 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

    #120682
    Brook
    Participant

    Howdy 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

    #180831
    timwakeling
    Participant

    Hi 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

    #183821
    timwakeling
    Participant

    Update: 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 );
    }

    #183966
    Brook
    Participant

    Thank 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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Events List Widget’ is closed to new replies.