If you need some custom logic, you can use the public API exposed by the plugin. You can use the calls below throughout your WordPress website.

Note: this article is about the API for the premium version. The free version has a similar API, just replace MBHIPRO() with MBHILITE()

API Calls

MBHIPRO()->is_open('location name')

Returns true if the location is currently open. False otherwise.

 

MBHIPRO()->is_closed('location name')

Returns true if the location is currently closed. False otherwise.

 

MBHIPRO()->get_opening_hours('location name')

Returns an array of objects containing the location’s opening hours.

 

MBHIPRO()->get_specials('location name')

Returns an array of objects containing the location’s special opening hours.

 

MBHIPRO()->get_vacations('location name')

Returns an array of objects containing the location’s vacations.

 

MBHIPRO()->get_opening_hours_on('location name', $aDateTimeObject)

Returns the opening hours for a given date. Returns false if the location is closed that day.