Skip to content
Docs
Get RestroPress

Filter

rpress_basic_holidays

Updated
On this page

Filters the list of configured basic holiday dates.

Runs in rpress_get_basic_holidays() on the basic_holidays setting after it has been sanitized and trimmed to at most five entries. Dates are Y-m-d strings. Adding entries here makes rpress_is_basic_holiday() treat those dates as closed.

Parameters#

ParameterTypeDescription
$holidaysarrayHoliday dates as Y-m-d strings, re-indexed from zero.

Return value#

array. List of Y-m-d date strings.

Example#

function my_extra_holidays( $holidays ) {
	$holidays[] = gmdate( 'Y' ) . '-12-25';
	return array_values( array_unique( $holidays ) );
}
add_filter( 'rpress_basic_holidays', 'my_extra_holidays' );

Notes#

The five-date cap is applied before this filter, so filtered lists can exceed five.

Source#

Applied in:

  • includes/rp-store-hours-basic.php (line 43), in rpress_get_basic_holidays()

See also#

Was this page helpful?