Alright, thanks to @chakradeo and the patch he referenced in his previous response, my clients’ site is now displaying only the “Visible” classes in the Weekly Class Schedule widget, rather than ignoring the “Visible” vs. “Hidden” setting.
However, since his response was formatted as a patch, and the subsequent commenter modified the code somewhat, I’m including below the exact modifications I made so that others who need to make this change can perhaps do so a bit more easily.
In the wcs3_widgets.php file (found in the plugin’s includes directory), locate the line that reads
$output .= '<ul class="wcs3-today-classes-widget-list">';
For me, this was line 59. Here’s what I have edited beginning two lines below that point:
// Original Widget Code Below
/* foreach ( $schedule as $key => $entry ) {
$start_hour = $entry['start_hour'];
$class_name = $entry['class'];
$output .= "<li>$start_hour - $class_name</li>";
}
$output .= '</ul>';
*/
// Modified Widget Code
foreach ( $schedule as $key => $entry ) {
if($entry['visible'] != 'Hidden') {
$start_hour = $entry['start_hour'];
$class_name = $entry['class'];
$output .= "<li>$start_hour - $class_name</li>";
}
}
$output .= '</ul>';
This effectively replaces the code that previously ended with the last line I included above (the one that reads $output .= '</ul>';
I hope this is clear for users that may perhaps be less experienced with PHP code. It’s working perfectly for me.
Thanks!