Title: WP_HTML_Active_Formatting_Elements::push
Published: November 8, 2023
Last modified: February 24, 2026

---

# WP_HTML_Active_Formatting_Elements::push( WP_HTML_Token $token )

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_html_active_formatting_elements/push/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/classes/wp_html_active_formatting_elements/push/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/classes/wp_html_active_formatting_elements/push/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_html_active_formatting_elements/push/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_html_active_formatting_elements/push/?output_format=md#changelog)

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

Pushes a node onto the stack of active formatting elements.

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

### 󠀁[See also](https://developer.wordpress.org/reference/classes/wp_html_active_formatting_elements/push/?output_format=md#see-also)󠁿

 * [https://html.spec.whatwg.org/#push-onto-the-list-of-active-formatting-elements](https://html.spec.whatwg.org/#push-onto-the-list-of-active-formatting-elements/)

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

 `$token`[WP_HTML_Token](https://developer.wordpress.org/reference/classes/wp_html_token/)
required

Push this node onto the stack.

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

    ```php
     */
    public function push( WP_HTML_Token $token ) {
    	/*
    	 * > If there are already three elements in the list of active formatting elements after the last marker,
    	 * > if any, or anywhere in the list if there are no markers, that have the same tag name, namespace, and
    	 * > attributes as element, then remove the earliest such element from the list of active formatting
    	 * > elements. For these purposes, the attributes must be compared as they were when the elements were
    	 * > created by the parser; two elements have the same attributes if all their parsed attributes can be
    	 * > paired such that the two attributes in each pair have identical names, namespaces, and values
    	 * > (the order of the attributes does not matter).
    	 *
    	 * @todo Implement the "Noah's Ark clause" to only add up to three of any given kind of formatting elements to the stack.
    	 */
    	// > Add element to the list of active formatting elements.
    	$this->stack[] = $token;
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/html-api/class-wp-html-active-formatting-elements.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/html-api/class-wp-html-active-formatting-elements.php#L114)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/html-api/class-wp-html-active-formatting-elements.php#L114-L128)

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

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

## User Contributed Notes

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