Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Separator block made with text expansion doesn't use default block variation | GoodFirstPicks

Separator block made with text expansion doesn't use default block variation

WordPress/gutenberg 3 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeWordPressJavaScriptReact

Why this is a good first issue

Text expansion creates separator blocks differently than inserter, but reproducibility is uncertain.

AI Summary

The issue reports that separator blocks created via text expansion don't respect default variations, while those inserted normally do. However, maintainers couldn't reproduce, suggesting the problem might be environment-specific. The fix would need to ensure consistent variation handling across all block creation methods.

Issue Description

Description

It is possible to register a default block variation to customize the settings of any block, including the Separator.

This works when inserting the separator in most ways, but not when creating a separator by typing --- + ENTER.

I would expect all new blocks to use the default block variation settings regardless of how they are created.

Step-by-step reproduction instructions

  1. Register a default block variation for the Separator (see code below)
  2. Insert Separator block using block inserter.
  3. Observe correct variation is used with div instead of hr
  4. Type --- and ENTER to make a Separator block.
  5. Observe that the Separator block is still using the hr element, contrary to the default block variation
namespace Gutenberg\Bug\Report;

add_filter( 'get_block_type_variations', __NAMESPACE__ . '\block_variations', 10, 2 );
/**
 * Register block variations in PHP for the block editor
 *
 * @param array $variations array of arrays for each block's variations
 * @param object $block block meta for each block, useful for checking $block->name to target a specific block
 * @return array $variations updated array containing variations to register
 */
function block_variations( $variations, $block ) {
	$block_name = $block->name;
	switch ( $block_name ) {
		// use non-semantic separator by default
		case 'core/separator':
			$variations[] = [
				'name' => 'separator',
				'isDefault' => true,
				'attributes' => [
					'tagName' => 'div',
				],
			];
			break;
	}

	return $variations;
}

Screenshots, screen recording, code snippet

No response

Environment info

  • WP 6.9.1
  • Custom Theme
  • No Gutenberg plugin

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.j

GitHub Labels

[Type] Bug[Feature] Block Transforms[Block] Separator

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • reproducibility unclear
  • potential core editor behavior
Loading labels...

Details

Points10 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno