X Features Cars Demo Power Plants Demo State Parks Demo Site Showcase Docs Tutorials Add-ons Buy

facetwp_builder_item_value

Overview

This filter lets you modify the value of a Layout Builder item.

Parameters

$item = array(
    'source' => 'cf/photo_url',
    'settings' => array(
        'prefix' => '',
        'suffix' => '',
        'is_hidden' => false,
        'name' => 'photo_url',
        'css_class' => '',
        /* other settings based on the item type */
    )
);

Usage

// Append the suffix if the value isn't empty
add_filter( 'facetwp_builder_item_value', function( $value, $item ) {
    if ( ! empty( $value ) ) {
        $value = $value . $item['settings']['suffix'];
    }
    return $value;
}, 10, 2 );