Skip to content
Docs
Get RestroPress

Filter

rpress_settings_{$tab}_sanitize

Updated
On this page

Filters the posted settings of one tab before they are merged and sanitized.

Runs while the settings form is saved, when the request carries a referrer that identifies the tab. The dynamic part is the tab ID. The array is the raw submitted rpress_settings input; return it after adding or changing keys, for example to store data outside the main option.

Parameters#

ParameterTypeDescription
$inputarrayThe submitted settings for the form.

Return value#

array. The submitted settings.

Example#

function my_taxes_tab_sanitize( $input ) {
	if ( isset( $input['my_tax_label'] ) ) {
		$input['my_tax_label'] = sanitize_text_field( $input['my_tax_label'] );
	}
	return $input;
}
add_filter( 'rpress_settings_taxes_sanitize', 'my_taxes_tab_sanitize', 10, 1 );

Source#

Applied in:

  • includes/admin/settings/register-settings.php (line 1890), in rpress_settings_sanitize()

See also#

Was this page helpful?