Archives block Drop-down issue #70508
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Closes #13771
Fix Archives block dropdown functionality by making it interactive in the editor and functional on the frontend, aligning with the Category block behavior.
Why?
The Archives block's "Display as Drop-down" option was not working properly. When users selected this option, the dropdown was rendered but was disabled and non-functional. This created a poor user experience and accessibility issues, as the dropdown appeared to be broken rather than clearly indicating its disabled state.
As discussed in issue #13771, the ideal solution is to make archive blocks work like category blocks - being both accessible and using the same interaction patterns for consistency across the editor.
How?
The implementation includes two main changes:
Editor Changes (
packages/block-library/src/archives/edit.js
):Disabled
wrapper around theServerSideRender
componentDisabled
importFrontend Changes (
packages/block-library/src/archives/index.php
):onchange
attribute from the select elementbuild_dropdown_script_block_core_archives()
that generates proper JavaScript for dropdown functionalitywp_get_inline_script_tag()
for proper script injection following WordPress standardsTesting Instructions
Screenshots or screencast
The dropdown now functions consistently between editor and frontend, matching the Category block behavior for improved user experience
Before
Screen.Recording.2025-06-24.at.2.49.55.PM.mov
After
Screen.Recording.2025-06-24.at.2.53.20.PM.mov