Toggle Filed

Toggle is something like turn on and turn off switch, allows to pass command that toggles between two modes,

Field Parameters

Name Type Default Description
type string toggle Value identifies the field types.
id string Identifies unique ID for the field. It must be different from other existing field IDs.
title string Displays the field label
desc string Describe the field option in details, appears underneath the field control.
value boolean true Default value is true. Available value is: true, false

Example Declaration

    'id'    => 'toggle',
    'title' => esc_html__( 'Label', 'ultimate-page-builder' ),
    'desc'  => wp_kses_post( __( 'Description', 'ultimate-page-builder' )),
    'type'  => 'toggle',
    'value' => true, // true | false

To use enable as element attribute there is a built-in function for ID enable.

upb_enable_input('Title', 'Description', true)
  • Available Hook: upb_enable_input

results matching ""

    No results matching ""