woof_front_builder_option
Filters the value of an individual front builder option after it has been loaded from the database, allowing runtime modification of option values.
Parameter
$value (mixed) — The current value of the front builder option loaded from the database
$field (string) — The field key/name of the option being filtered
Quelldatei
ext/front_builder/classes/options.php:94
Codebeispiel
add_filter('woof_front_builder_option', function($value, $field) {
if ('max_posts' === $field) {
return min($value, 50);
}
return $value;
}, 10, 2);
Verwendungshinweise
- Each option is defined in options.php with a 'field' key that is passed as the second parameter.
- Only runs when the option's field key exists in the database-stored options data.
- Part of the Front Builder extension for managing widget-style filter layouts.