"Filter: bricks/conditions/options"
گزینههای شرط موجود در رابط شرایط عنصر را فیلتر میکند. این به شما امکان میدهد شرایط سفارشی را اضافه کنید که کاربران میتوانند برای کنترل دید عنصر انتخاب کنند.
پارامترها
$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;
} );