Add a Column Link option to the native Columns block - #296
Open
Castellon-ACM wants to merge 1 commit into
Open
Conversation
Adds a "FrontBlocks - Column Link" panel to core/column's Inspector Controls. Setting a URL makes the whole column clickable on the frontend (optionally in a new tab), without hijacking clicks on a real link, button, or other interactive element already inside it. The column is keyboard-accessible (role="link", tabindex="0", Enter/Space activation) and gets a dashed-outline hint in the editor. Follows the same native-block-extension pattern already used for core/columns (ColumnsSameHeight) and core/button (DownloadButton): attributes registered server-side via register_block_type_args, output rewritten at render time via render_block_core/column — nothing is altered client-side in the saved block content.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #295.
Adds a "FrontBlocks - Column Link" panel to the native
core/columnblock's Inspector Controls. Setting a URL makes the whole column clickable on the frontend (optionally in a new tab), without hijacking clicks on a real link, button, or other interactive element already inside it.register_block_type_argsforcore/columnonly (frblColumnLinkUrl,frblColumnLinkNewTab).render_block_core/column— the wrapper getsclass="frbl-column-link",data-frbl-column-link-url(escaped withesc_url(), which also rejects unsafe schemes likejavascript:),role="link",tabindex="0", anddata-frbl-column-link-target="_blank"when new-tab is enabled. Nothing is altered client-side in the saved block content.core/columns(ColumnsSameHeight) andcore/button(DownloadButton).Test plan
composer lintandcomposer phpstancleanColumnLinkTest.phpcovers attribute registration, the render_block rewrite (classes/attributes/escaping), the unsafe-scheme rejection, and asset registration/enqueueingtests/js/column-link-frontend.test.js(Node test runner, matching the existing frontend-JS test pattern) covers click delegation (background click navigates, nested link/button clicks are not hijacked), new-tab handling, and keyboard activation