gpb_google_calendar_event_block_data

  1. Description
  2. Usage
  3. Parameters
  4. Examples
    1. Skip events marked as Free so their slots stay bookable.
  5. Since

Description

Filter the availability block data generated from a Google Calendar event.

Usage

Applied globally

add_filter( 'gpb_google_calendar_event_block_data', 'my_custom_function' );

Parameters

$block_data array|null

The generated block data, or null to skip the event.

$event array|ArrayAccess

The Google Calendar event.

$bookable Bookable

The bookable object.

$now CarbonCarbonImmutable

Current time.

Examples

Skip events marked as Free so their slots stay bookable.

add_filter( 'gpb_google_calendar_event_block_data', function( $block_data, $event ) {
    if ( ( $event['transparency'] ?? null ) === 'transparent' ) {
        return null;
    }
    return $block_data;
}, 10, 2 );

Since

  • 1.0-beta-2.6 Hook added.