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 2.8.0
*
* @param array $args Display arguments including ‘before_title’, ‘after_title’,
* ‘before_widget’, and ‘after_widget’.
* @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