Hidden Field

Hidden Field

IntroductionExampleUses

Introduction
The hidden type field, part of the Settings API, renders a hidden input.
Example
The HTML is created for the hidden field and you will see it if you view the page』s HTML source.
array(
'title' => esc_html__( 'This is the title for Section 4', 'sometextdomain' ),
'fields' => array(
array(
'type' => 'hidden',
'name' => 'myhiddenfield',
'label' => esc_html__( 'This is my hidden field', 'sometextdomain' ),
'default_value' => 'textformyhiddenfield',
),
),
),

The HTML code generated for the hidden field will look similar to the following:

Uses

settings_hidden()

發表回覆

您的電子郵箱地址不會被公開。 必填項已用 * 標註