gpb_min_block_size

  1. Description
  2. Usage
  3. Parameters
  4. Examples
    1. Allow 4-minute blocks for a specific service.
  5. Since

Description

Filter the minimum allowed block size. This can be used to opt into smaller block sizes for specific installs or services. Core defaults to 5 minutes.

Usage

Applied globally

add_filter( 'gpb_min_block_size', 'my_custom_function' );

Parameters

$min_block_size int

The minimum allowed block size in minutes.

$service Service

The service object.

Examples

Allow 4-minute blocks for a specific service.

add_filter( 'gpb_min_block_size', function( $min_block_size, $service ) {
    if ( $service->get_id() === 123 ) {
        return 4;
    }
    return $min_block_size;
}, 10, 2 );

Since

  • 1.0-beta-2.8 Hook added.