Title: WP_Theme_JSON::update_paragraph_text_indent_selector
Published: May 20, 2026

---

# WP_Theme_JSON::update_paragraph_text_indent_selector( array $feature_declarations, array $settings, string $block_name ): array

## In this article

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

[ Back to top](https://developer.wordpress.org/reference/classes/wp_theme_json/update_paragraph_text_indent_selector/?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.

Updates the text indent selector for paragraph blocks based on the textIndent setting.

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

The textIndent setting can be ‘subsequent’ (default), ‘all’, or false.
When set 
to ‘all’, the selector should be ‘.wp-block-paragraph’ instead of ‘.wp-block-paragraph
+ .wp-block-paragraph’ to apply indent to all paragraphs.

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

 `$feature_declarations`arrayrequired

The feature declarations keyed by selector.

`$settings`arrayrequired

The theme.json settings.

`$block_name`stringrequired

The block name being processed.

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

 array The updated feature declarations.

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

    ```php
    private static function update_paragraph_text_indent_selector( $feature_declarations, $settings, $block_name ) {
    	if ( 'core/paragraph' !== $block_name ) {
    		return $feature_declarations;
    	}

    	// Check block-level settings first, then fall back to global settings.
    	$block_settings      = $settings['blocks']['core/paragraph'] ?? null;
    	$text_indent_setting = $block_settings['typography']['textIndent']
    		?? $settings['typography']['textIndent']
    		?? 'subsequent';

    	if ( 'all' !== $text_indent_setting ) {
    		return $feature_declarations;
    	}

    	// Look for the text indent selector and replace it.
    	$old_selector = '.wp-block-paragraph + .wp-block-paragraph';
    	$new_selector = '.wp-block-paragraph';

    	if ( isset( $feature_declarations[ $old_selector ] ) ) {
    		$declarations = $feature_declarations[ $old_selector ];
    		unset( $feature_declarations[ $old_selector ] );
    		$feature_declarations[ $new_selector ] = $declarations;
    	}

    	return $feature_declarations;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-theme-json.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/class-wp-theme-json.php#L2768)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/class-wp-theme-json.php#L2768-L2794)

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

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

## User Contributed Notes

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