Make WordPress Core

Opened 8 months ago

Last modified 3 months ago

#56852 reopened enhancement

Support IDs in block wrapper attributes

Reported by: soean's profile Soean Owned by: flixos90's profile flixos90
Milestone: 6.3 Priority: normal
Severity: normal Version:
Component: Editor Keywords: gutenberg-merge
Focuses: Cc:


At the moment dynamic rendered blocks don't support anchors.

To enable this support, we need to add this feature to the Editor and add the id in get_block_wrapper_attributes() to the block.

I already created a PR to add this support to the editor:

This ticket is for adding it to the renderd block HTML.

Change History (11)

This ticket was mentioned in PR #3497 on WordPress/wordpress-develop by @Soean.

8 months ago

  • Keywords has-patch added

Adds the support for the ID attribute for dynamic rendered blocks.

Trac ticket:

Enable support in the Editor:

#2 @poena
5 months ago

  • Milestone changed from Awaiting Review to 6.2

It would be good if we could solve this in 6.2

#3 @costdev
4 months ago

This ticket is blocked until the corresponding editor PR is merged and backported to Core.

I've reached out to @annezazu to get confirmation on whether this is likely to land in 6.2.

Let's give the Editor Triage/Tech leads time to evaluate if this can land, otherwise we can move this ticket to the 6.3 milestone when it becomes available.

#4 @Soean
4 months ago

The editor PR is merged.
I backported the PHP changes to this ticket PR:

#5 @Mamaduka
4 months ago

  • Keywords gutenberg-merge added

#6 @flixos90
4 months ago

  • Owner set to flixos90
  • Status changed from new to reviewing

#7 @jorgefilipecosta
4 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 55230:

Block editor: Add ID support to block wrapper attributes.

This commit adds support for the ID attribute for dynamically rendered blocks.

Props Soean, flixos90, poena, costdev, Mamaduka.
Closes #56852.

#9 @hellofromTonya
3 months ago

  • Milestone changed from 6.2 to 6.3
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening as [55230] introduced a content markup regression. See #57830 for details.

#10 @hellofromTonya
3 months ago

In 55443:

Editor: Partial revert of r55230.

[55230] introduced a regression to the content markup. This changeset is a partial revert to remove the added wp-includes/block-supports/anchor.php file.

The change of adding 'id' to $attributes_to_merge in get_block_wrapper_attributes() is not reverted as this change did not impact the regression and helps to support continue development in Gutenberg for the anchor support in dynamic blocks feature.


Follow-up [55230].

Props wildworks, mamaduka, hellofromTonya.
Fixes #57830.
See #56852.

#11 @hellofromTonya
3 months ago

  • Keywords has-patch removed
Note: See TracTickets for help on using tickets.