wpsl_hour_shortcode_defaults

  1. Description
  2. Parameters
  3. Usage
  4. Changelog
  5. Source File
  6. Related

Description

This filter allows you to change the default options for the opening hours shortcode.

Parameters

$shortcode_defaults - (array) The current defaults for the opening hours shortcode.

Usage

This example hides the opening hours if they are set to “closed” for that day:

The only other attribute you can change for the opening hours shortcode is the id.

If the id field is left empty, it will default to the id from the current page. But this will only work if the shortcode is used on a store page, otherwise the id field is required.

Changelog

Since 2.0

Source File

This filter is located in /frontend/class-frontend.php.

Placement

The code needs to be placed in the functions.php file inside your active theme folder.