Skip to content
Docs
Get RestroPress

Filter

rpress_allowed_html_tags

Updated
On this page

Filters the HTML tags and attributes allowed in text settings.

Runs inside rpress_sanitize_text_field(), the sanitizer for text-type settings. The array is in wp_kses format: tag name => allowed attributes. The default allows p, span, a, strong, em, br, img, div, ul and li with a small set of attributes.

Parameters#

ParameterTypeDescription
$allowed_tagsarraywp_kses allowed tags array.

Return value#

array. The allowed tags array.

Example#

function my_allowed_setting_tags( $allowed_tags ) {
	$allowed_tags['code'] = array();
	return $allowed_tags;
}
add_filter( 'rpress_allowed_html_tags', 'my_allowed_setting_tags', 10, 1 );

Source#

Applied in:

  • includes/admin/settings/register-settings.php (line 2188), in rpress_sanitize_text_field()

See also#

  • rpress_settings_sanitize_%7B%24type%7D
Was this page helpful?