Title: _wp_kses_allow_note_mention_span
Published: August 20, 2026

---

# _wp_kses_allow_note_mention_span( $allowed, string $context ): array<string,

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/_wp_kses_allow_note_mention_span/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/_wp_kses_allow_note_mention_span/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/_wp_kses_allow_note_mention_span/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/_wp_kses_allow_note_mention_span/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/functions/_wp_kses_allow_note_mention_span/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/_wp_kses_allow_note_mention_span/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Allows the note mention chip markup in comment content.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/_wp_kses_allow_note_mention_span/?output_format=md#description)󠁿

The notes `@` mention completer stores a mention as a chip carrying the mentioned
user’s ID in a class token: `<span class="wp-note-mention user-N">@Name</span>`.
The default comment allowlist does not allow `span` at all, so for users without`
unfiltered_html` the mention would be stripped on save.

The allowance is deliberately narrow and always on: `span` is a semantics-free element
and [_wp_kses_sanitize_note_mention_classes()](https://developer.wordpress.org/reference/functions/_wp_kses_sanitize_note_mention_classes/)
reduces its `class` to the two mention tokens right after kses runs, so regular (
including anonymous) commenters gain nothing beyond the inert mention markup itself.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/_wp_kses_allow_note_mention_span/?output_format=md#parameters)󠁿

array<string, bool>> $allowed The allowed tags structure for the context.

`$context`stringrequired

The kses context.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/_wp_kses_allow_note_mention_span/?output_format=md#return)󠁿

 array<string, array<string, bool>> Modified allowed tags structure.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/_wp_kses_allow_note_mention_span/?output_format=md#source)󠁿

    ```php
    function _wp_kses_allow_note_mention_span( $allowed, $context ): array {
    	if ( ! is_array( $allowed ) ) {
    		$allowed = array();
    	}
    	if ( 'pre_comment_content' !== $context ) {
    		return $allowed;
    	}

    	if ( ! isset( $allowed['span'] ) || ! is_array( $allowed['span'] ) ) {
    		$allowed['span'] = array();
    	}

    	$allowed['span']['class'] = true;

    	return $allowed;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/kses.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/kses.php#L1157)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/kses.php#L1157-L1172)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/_wp_kses_allow_note_mention_span/?output_format=md#changelog)󠁿

| Version | Description | 
| [7.1.0](https://developer.wordpress.org/reference/since/7.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2F_wp_kses_allow_note_mention_span%2F)
before being able to contribute a note or feedback.