Title: WP_HTML_Processor::step_in_row
Published: February 24, 2026

---

# WP_HTML_Processor::step_in_row(): bool

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_html_processor/step_in_row/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/classes/wp_html_processor/step_in_row/?output_format=md#see-also)
 * [Return](https://developer.wordpress.org/reference/classes/wp_html_processor/step_in_row/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_html_processor/step_in_row/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_html_processor/step_in_row/?output_format=md#changelog)

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.

Parses next element in the ‘in row’ insertion mode.

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

This internal function performs the ‘in row’ insertion mode logic for the generalized
[WP_HTML_Processor::step()](https://developer.wordpress.org/reference/classes/wp_html_processor/step/)
function.

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

 * [https://html.spec.whatwg.org/#parsing-main-intr](https://html.spec.whatwg.org/#parsing-main-intr/)
 * [WP_HTML_Processor::step](https://developer.wordpress.org/reference/classes/WP_HTML_Processor/step/)

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

 bool Whether an element was found.

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

    ```php
    	 * > Anything else
    	 * >   Process the token using the rules for the "in body" insertion mode.
    	 */
    	return $this->step_in_body();
    }

    /**
     * Parses next element in the 'in column group' insertion mode.
     *
     * This internal function performs the 'in column group' insertion mode
     * logic for the generalized WP_HTML_Processor::step() function.
     *
     * @since 6.7.0
     * @ignore
     *
     * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
     *
     * @see https://html.spec.whatwg.org/#parsing-main-incolgroup
     * @see WP_HTML_Processor::step
     *
     * @return bool Whether an element was found.
     */
    private function step_in_column_group(): bool {
    	$token_name = $this->get_token_name();
    	$token_type = $this->get_token_type();
    	$op_sigil   = '#tag' === $token_type ? ( parent::is_tag_closer() ? '-' : '+' ) : '';
    	$op         = "{$op_sigil}{$token_name}";

    	switch ( $op ) {
    		/*
    		 * > A character token that is one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF),
    		 * > U+000C FORM FEED (FF), U+000D CARRIAGE RETURN (CR), or U+0020 SPACE
    		 */
    		case '#text':
    			if ( parent::TEXT_IS_WHITESPACE === $this->text_node_classification ) {
    				// Insert the character.
    				$this->insert_html_element( $this->state->current_token );
    				return true;
    			}

    			goto in_column_group_anything_else;
    			break;

    		/*
    		 * > A comment token
    		 * > A processing instruction token
    		 */
    		case '#comment':
    		case '#funky-comment':
    		case '#presumptuous-tag':
    		case '#processing-instruction':
    			$this->insert_html_element( $this->state->current_token );
    			return true;

    		/*
    		 * > A DOCTYPE token
    		 */
    		case 'html':
    			// @todo Indicate a parse error once it's possible.
    			return $this->step();

    		/*
    		 * > A start tag whose tag name is "html"
    		 */
    		case '+HTML':
    			return $this->step_in_body();

    		/*
    		 * > A start tag whose tag name is "col"
    		 */
    		case '+COL':
    			$this->insert_html_element( $this->state->current_token );
    			$this->state->stack_of_open_elements->pop();
    			return true;

    		/*
    		 * > An end tag whose tag name is "colgroup"
    		 */
    		case '-COLGROUP':
    			if ( ! $this->state->stack_of_open_elements->current_node_is( 'COLGROUP' ) ) {
    				// @todo Indicate a parse error once it's possible.
    				return $this->step();
    			}
    			$this->state->stack_of_open_elements->pop();
    			$this->state->insertion_mode = WP_HTML_Processor_State::INSERTION_MODE_IN_TABLE;
    			return true;

    		/*
    		 * > An end tag whose tag name is "col"
    		 */
    		case '-COL':
    			// Parse error: ignore the token.
    			return $this->step();
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/html-api/class-wp-html-processor.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/html-api/class-wp-html-processor.php#L3783)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/html-api/class-wp-html-processor.php#L3783-L3876)

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

| Version | Description | 
| [6.7.0](https://developer.wordpress.org/reference/since/6.7.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_processor%2Fstep_in_row%2F)
before being able to contribute a note or feedback.