WordPress at a glance

settings_fields() WP 1.0

Output nonce, action, and option_page fields for a settings page.

Works based on: wp_nonce_field()

No Hooks.

Return

Null. Nothing.

Usage

settings_fields( $option_group );
$option_group(string) (required)
A settings group name. This should match the group name used in register_setting().

Changelog

Since 2.7.0 Introduced.

Code of settings fields: wp-admin/includes/plugin.php WP 5.2.2

<?php
function settings_fields( $option_group ) {
	echo "<input type='hidden' name='option_page' value='" . esc_attr( $option_group ) . "' />";
	echo '<input type="hidden" name="action" value="update" />';
	wp_nonce_field( "$option_group-options" );
}

Related Functions

From category: Settings API

No comments
    Hello, !     Log In . Register