Skip to content
Docs
Get RestroPress

Filter

rpress_settings_general

Updated
On this page

Filters the settings registered for the General tab.

Runs while RestroPress builds its registered settings. The array is keyed by section ID (main, api, currency, accounting, order_notification, service_options, checkout_options and print_receipts), and each section is an array of setting ID => field definition with keys such as id, name, desc, type and std. Add, remove or change fields to extend the tab.

Parameters#

ParameterTypeDescription
$settingsarrayArray of section ID => array of setting ID => field definition.

Return value#

array. The section => settings array.

Example#

function my_add_general_setting( $settings ) {
	$settings['main']['my_extension_option'] = array(
		'id'   => 'my_extension_option',
		'name' => esc_html__( 'My option', 'my-plugin' ),
		'desc' => esc_html__( 'Explain what the option does.', 'my-plugin' ),
		'type' => 'text',
	);
	return $settings;
}
add_filter( 'rpress_settings_general', 'my_add_general_setting', 10, 1 );

Notes#

The General tab is regrouped into its display sections by rpress_reorganize_general_settings() after this filter runs, so fields added to a section ID are moved with the others.

Source#

Applied in:

  • includes/admin/settings/register-settings.php (line 398), in rpress_get_registered_settings()

See also#

Was this page helpful?