PHP Filters
lzb/control_value
Filters control value in block render.
Attributes
Name | Type | Description |
---|---|---|
$value | Mixed | value |
$control_data | Array | control data |
$block_data | Array | block data |
$context | String | rendering context [editor , frontend ] |
Additional Filters
Name | Description |
---|---|
lzb/control_value/control_type=CONTROL_TYPE | filter value of specific control type |
lzb/control_value/control_name=CONTROL_NAME | filter value of specific control name |
lzb/control_value/block_slug=BLOCK_SLUG | filter value of all controls of specific block |
Usage
PHP
function my_lzb_control_value( $value, $control_data, $block_data, $context ) {
// Change all color values output to black.
if ( 'color' === $control_data['type'] ) {
$result = '#000';
}
return $result;
}
add_filter( 'lzb/control_value', 'my_lzb_control_value', 10, 4 );