Skip to main content

Hidden

Type: hidden

Description

A hidden input field that stores a value without displaying any visible UI to the user. Useful for storing internal data, computed values, or state that should not be directly editable by the user.

Basic Usage

[
"type" => "hidden",
"param_name" => "your_param_name",
"value" => "",
]

Common Parameters

All param types support these common parameters:

ParameterTypeDescription
typeStringRequired. Must be "hidden"
holderStringHTML tag name where the value is displayed in backend edit mode. Default: hidden input
classStringCSS class added to the holder HTML tag
headingStringLabel shown in the editor interface
param_nameStringRequired. Parameter name used in shortcode
valueMixedValue for the parameter
descriptionStringHelp text shown below the field
groupStringTab/group name to organize parameters
sectionStringSection slug to visually group params within a tab
weightIntegerDisplay order (higher = shows first)
edit_field_classStringCSS class for field width (e.g., "vc_col-sm-6")
dependencyArrayShow/hide based on other field values
admin_labelBooleanShow value in element title bar
param_holder_classStringCSS class for the param wrapper in the edit element modal
save_alwaysBooleanForce saving the value even if it equals the default or is empty
callbackArrayJavaScript function callback (e.g., ['after_add' => 'myCallback'])
settingsArrayType-specific configuration options (see Type-Specific Parameters below)
deprecatedStringVersion in which the param was deprecated

Type-Specific Parameters

ParameterTypeDefaultDescription
stdMixed-Default param value (alternative to value)

Complete Example

<?php
add_action('vc_before_init', 'my_element_with_hidden');
function my_element_with_hidden() {
vc_map([
"name" => __("My Element", "domain"),
"base" => "my_element",
"category" => __("My Category", "domain"),
"params" => [
[
"type" => "textfield",
"heading" => __("Title", "domain"),
"param_name" => "title",
],
[
"type" => "hidden",
"param_name" => "internal_id",
"value" => "",
],
],
]);
}
info

Since this param type renders as a hidden input, it does not appear in the element's edit form. It is typically used to store values set programmatically via JavaScript or other param interactions.