Skip to content
Docs
Get RestroPress

Filter

rpress_settings_sections_general

Updated
On this page

Filters the list of sections shown in the General settings tab.

Runs when the settings sections are first built, before the combined rpress_settings_sections filter. The array maps a section slug to its label; the labels become the sub-navigation of the General tab. A section only shows settings that are registered for that tab and section slug through the rpress_registered_settings filter. The result is cached in a static variable for the rest of the request. The Delivery Fee section is only present while the flat delivery fee is active.

Parameters#

ParameterTypeDescription
$sectionsarrayAssociative array of section slug => section label.

Return value#

array. The section slug => label array.

Example#

function my_add_general_section( $sections ) {
	$sections['my_section'] = __( 'My Section', 'my-plugin' );
	return $sections;
}
add_filter( 'rpress_settings_sections_general', 'my_add_general_section' );

Source#

Applied in:

  • includes/admin/settings/register-settings.php (line 2265), in rpress_get_registered_settings_sections()

See also#

Was this page helpful?