';
}
// Security field(protects against CSRF)
settings_fields('addresswise-settings-page');
// Output settings section
do_settings_sections('addresswise-settings-page');
// Save settings button
submit_button('Save Settings');
?>
'string',
'sanitize_callback' => 'sanitize_text_field',
'default' => ''
)
);
// Add text fields
add_settings_field(
'addresswise_settings_input_field',//match with register_setting option name
__('Client token', 'addresswise'),//title
'addresswise_settings_input_field_callback',
'addresswise-settings-page', //page id
'addresswise_settings_section'//section id
);
}
add_action('admin_init', 'addresswise_settings_init');
function addresswise_settings_input_field_callback()
{
$addresswise_input_field = get_option('addresswise_settings_input_field');
// It retrieves the current value of "addresswise_settings_input_field" from the WordPress options table using get_option and displays it in the input field.
?>