Skip to content
Get Bricks

Filter: bricks/conditions/options

Filters the condition options available in the element conditions interface. This allows you to add custom conditions that users can select to control element visibility.

  • $options (array): Array of condition options. Each option defines the condition key, label, group, comparison operators, and value input type.
add_filter( 'bricks/conditions/options', function( $options ) {
// Add a custom 'Is Weekend' condition
$options[] = [
'key' => 'is_weekend',
'group' => 'other', // Or a custom group created via bricks/conditions/groups
'label' => esc_html__( 'Is Weekend', 'my-plugin' ),
'compare' => [
'type' => 'select',
'options' => [
'==' => esc_html__( 'is', 'bricks' ),
],
],
'value' => [
'type' => 'select',
'options' => [
'true' => esc_html__( 'True', 'bricks' ),
'false' => esc_html__( 'False', 'bricks' ),
],
],
];
return $options;
} );