apply_filters( 'lp__field_value/{id}', $value, $key, $data, $context )

This filter processes a field value based on its data type, potentially applying various transformations such as formatting numbers, displaying true/false values as text, formatting dates, handling images, evaluating expressions, or simply adding prepend and append values, and then returns the processed value.


Plugin


Namespace

Launchpad


Parameters

array

$value

Field elements attributes

WP_Post

$data

Post Object

mixed

$context (optional)

Additional context for the filter


Return

array

Filtered element attributes


Example

Let’s consider a specific field with the identifier field-settings as an example. We can customize its value and attributes using the lp__field_value/{id} filter.

add_filter( 'lp__field_value/field-settings', function ( $value, $key, $data, $context ) {
    // Apply default key if the field value is empty
    if ( empty( $value ) ) {
        $key = 'no-value-field';
    }
    // Return the modified value
    return $value;
}, 10, 4 );

After applying this customization, the value of the field with the identifier field-settings will be processed according to the defined filter callback function. If the value is empty, the default key no-value-field will be applied to the field.

Related

Allow filter for specific admin pages.

Allow filter for specific admin pages arguments.

Allow filter for all admin sub views arguments.

Allow filter for admin views arguments of specific admin page and view.

Allow filter for admin sub views arguments of specific admin page, view, and sub view.

Allow filter for admin sub views arguments of specific admin page.

Allow filter for specific admin sub view arguments.

Allow filter for admin sub view arguments of specific admin view.

Allow filter for admin sub views param.

Allow filter for admin sub views param of specific admin page.

Allow filter for admin sub views param of specific admin page and view.

Allow filter for admin sub views param of specific admin page view.

Allow filter for all admin toolbar arguments.

Allow filter for specific admin toolbar arguments.

Allow filter for all admin toolbar arguments.

Allow filter for specific admin toolbar arguments.

Allow filter for all admin views arguments.

Allow filter for admin views arguments of specific admin page and view.

Allow filter for admin views arguments of specific admin page.

Allow filter for specific admin view arguments.

Allow filter for all admin views param.

Allow filter for admin views param of specific admin page.

Allow filtering the button HTML text to render.

Allow filter for customizing the HTML items for contact details.

Allow filter for all field group arguments.

Allow filter for specific field group arguments.

Allow filtering the link HTML text to render.

Allow filtering of template parts to be rendered on a page.

Allow filtering of template parts to be rendered on a page for a specific template.

Allow filtering of template parts to be rendered on a page for a specific template and type.

Allow filter to customize the option of submit button HTML.

Allow filter for the HTML structure of price.

Allow filter for the price HTML arguments.

Allow filter for customizing the HTML items for social media links.