My Calendar
[resolved] Bug in mc_select_category function (2 posts)

  1. akhilstanislavose
    Posted 4 years ago #

    I was using the upcoming events widget to display events from a single category and and it just did not work. I searched the support forum and nobody have reported any issues regarding category trouble in upcoming widgets. So I did some debugging and found a simple bug in the code.

    my-calendar-limits.php, line 10
    if ( $category == 'all' || strpos( $category, "all" ) !== false ) {

    if the category is 'Football' or 'Baseball' or any other word with 'ball' as a substring, the condition will pass while it should not.

    this is how I fixed it.
    if ( preg_match('/^all$|^all,|,all$|,all,/i', $category) > 0 ) {


  2. Joe Dolson
    Plugin Author

    Posted 4 years ago #

    Good call. Thanks!


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • My Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic