Description
Changes proposed in this Pull Request
- Track “Template Part” Block -> Toolbar more menu -> “Detach blocks from template part” action
- Track any block -> Toolbar more menu -> “Make template part” action
- Make sure
replaceBlocks
isn’t tracked after “Make template part”
NOTE: The #53598 PR is a prerequisite for this PR.
We are firing both events twice. One with block_names
property and one without it. We do this to ensure the event is tracked all the time. The event fired with block_names
property will fail if there are way too many blocks involved. URL length of the request becomes too long and the browser fails to deliver it.
Testing instructions
- Follow steps to enable tracking debugging at PCYsg-nrf-p2
- Open Site Editor
- Select a Paragraph block
- Click on 3 dots (Options) in the toolbar menu
- Click on “Make Template Part”
- Confirm
wpcom_block_editor_convert_to_template_part
event is fired twice. One without block_names
and one with block_names
property.
- Confirm
replaceBlocks
is triggered, but no events are tracked
- Select the template part you just created
- Click on 3 dots (Options) in the toolbar menu
- Click on “Detach blocks from template part”
- Confim
wpcom_block_editor_template_part_detach_blocks
event is fired twice. One without block_names
and one with block_names
property.
- Confirm
replaceBlocks
is triggered, but no events are tracked (subscriber system utilized here)
Related to #53410
Unfortunately, no screenshots were provided by the developer.