Save Button

Save Button

IntroductionExample

Introduction
The save type field, part of the Settings API, renders a submit type input.
Example
The following example renders a section with a text input and a save button with custom error and success messages.
1234567891011121314151617array(    'title'  => esc_html__( 'This is the title for Section 1', 'sometextdomain' ),    'fields' => array(        array(            'type'  => 'text',            'name'  => 'mytextfield',            'label' => esc_html__( 'This is my text field', 'sometextdomain' ),        ),        array(            'type'     => 'save',            'messages' => array(                'error'   => esc_html__( 'Settings could not be updated.', 'sometextdomain' ),                'success' => esc_html__( 'Settings have been updated.', 'sometextdomain' ),            ),        ),    ),),
The code above will render a layout similar to the following:

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注