Below are various code snippets for the premium version of the plugin. You can add to your child theme’s functions.php file to enhance the output of the plugin.

Hide weekends (Saturday & Sunday) from the time table

add_filter('mbhi_hours_entry', 'mbhi_replace_day',10,3);

function mbhi_replace_day($entry,$location,$shortcode) {
    $weekend_names = array('Saturday','Sunday','Sat','Sun');

    if(in_array($entry->range, $weekend_names))
        return null;

    return $entry;
}

Replace the day of the week by “Today” when using the shortcode to only show today’s opening hours

add_filter('mbhi_hours_entry', 'mbhi_replace_day',10,3);

function mbhi_replace_day($entry,$location,$shortcode) {

    if($shortcode === 'mbhi_hours_today')
        $entry->range = __('Today','mabel-business-hours-indicator-pro');

    return $entry;

}

Add a separator between timeslots of the same day.

Before adding this code, go into the plugin settings > Table > Layout Settings > and turn on the “Line break” setting.

add_filter('mbhi_hours_entry', 'add_timeslot_separator',10,3);

function add_timeslot_separator($entry,$location,$shortcode) {	
    $entry->hours = str_replace('<br/>',' and ',$entry->hours);	
    return $entry;
}

Change AM/PM to a.m. and p.m.

add_filter('mbhi_hours_entry', 'mbhi_change_ampm',10,3);

function mbhi_change_ampm($entry,$location,$shortcode) {	
    $entry->hours = str_replace('AM','a.m.',$entry->hours);
    $entry->hours = str_replace('PM','p.m.',$entry->hours);	
	 
    return $entry;
}

Change the word “Closed” to “Not available”

add_filter('mbhi_hours_entry', 'mbhi_change_closed_message',10,3);

function mbhi_change_closed_message($entry,$location,$shortcode) {

    if($entry->hours === __('Closed','mabel-business-hours-indicator-pro'))
	$entry->hours = "Not available";
		
    return $entry;

}