Title: Calendar drop down empty
Last modified: January 8, 2022

---

# Calendar drop down empty

 *  [randrp](https://wordpress.org/support/users/randrp/)
 * (@randrp)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/calendar-drop-down-empty/)
 * I am trying to add a widget for my simple calendar. When I choose the widget 
   type I get to choose a title and a calendar. But the calendar drop down is empty.
 * I am using the calendar on other pages, and it shows under calendars from the
   dashboard.
 * I have also ensured I was on the latest version of simple calendar. I am on wordpress
   5.8.3 and php 7.4.27
 * Anyone have any thoughts?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [maniu](https://wordpress.org/support/users/maniu/)
 * (@maniu)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/calendar-drop-down-empty/#post-15239839)
 * I had the same issue. Its caused by WP 5.8 using block editor to manage widgets.
   Plugin will not load available calendars for it.
    To fix it, you can replace 
   lines 56-62 in includes/widgets/calendar.php with
 *     ```
       if ( is_admin() || wp_is_json_request() ) {
       	$this->calendars = simcal_get_calendars();
       }
       ```
   
 * Hope that helps!
 *  Thread Starter [randrp](https://wordpress.org/support/users/randrp/)
 * (@randrp)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/calendar-drop-down-empty/#post-15256016)
 * Thanks for the reply.
    My files names are slightly different, and that code looks
   rather different than anything in the function that is at the point. So I think
   we might be looking at different code.
 * My file is wp-includes/widgets/class-wp-widget-calendar.php
 * But the function at the spot does seem related.
 * The function at those line numbers is
    public function widget( $args, $instance){
 * It’s description matches the goal
    * Outputs the content for the current Calendar
   widget instance.
 * I don’t know php specifically, but I know lots of other languages. The function
   appears to output html. It looks to get the title from $title which is populated
   from $instance[‘title’].
 * Since I don’t see anything using $this-calendars my best guess is that I would
   need to override $instance with the call to simcal_get_calendars(). But that 
   seems odd as the instance was passed in, and instance is singular, while simcal_get_calendars
   implies it would return multiple calendars.
 * Here is the whole function for reference…
 * 
    /** * Outputs the content for the current Calendar widget instance. * * [@since](https://wordpress.org/support/users/since/)
   2.8.0 * * [@param](https://wordpress.org/support/users/param/) array $args Display
   arguments including ‘before_title’, ‘after_title’, * ‘before_widget’, and ‘after_widget’.*
   [@param](https://wordpress.org/support/users/param/) array $instance The settings
   for the particular instance of the widget. */ public function widget( $args, 
   $instance ) { $title = ! empty( $instance[‘title’] ) ? $instance[‘title’] : ”;
 *  /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php*/
   
   $title = apply_filters( ‘widget_title’, $title, $instance, $this->id_base );
 *  echo $args[‘before_widget’];
    if ( $title ) { echo $args[‘before_title’] . $
   title . $args[‘after_title’]; } if ( 0 === self::$instance ) { echo ‘<div id=”
   calendar_wrap” class=”calendar_wrap”>’; } else { echo ‘<div class=”calendar_wrap”
   >’; } get_calendar(); echo ‘</div>’; echo $args[‘after_widget’];
 *  self::$instance++;
    }
 * Any thoughts on why the files are named different and the code seems so different?
 * thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Calendar drop down empty’ is closed to new replies.

 * ![](https://ps.w.org/google-calendar-events/assets/icon-256x256.png?rev=1263960)
 * [Simple Calendar - Google Calendar Plugin](https://wordpress.org/plugins/google-calendar-events/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-calendar-events/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-calendar-events/)
 * [Active Topics](https://wordpress.org/support/plugin/google-calendar-events/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-calendar-events/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-calendar-events/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [randrp](https://wordpress.org/support/users/randrp/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/calendar-drop-down-empty/#post-15256016)
 * Status: not resolved