what is the meaning of settings_fields()

Via the Developer Reference (not the Codex)

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

Here’s the source code for it

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");
}  

so, it gives the form processor some info to work with for the current options page, and verification with nonce on submit.

UPDATE

It’s role is made more clear in the Settings API docs:

To display the hidden fields and handle security of your options form, the Settings API provides the settings_fields() function.
settings_fields( $option_group );

Leave a Comment