fix(list-table): port ACF _acf-copyable.js for click-to-copy field keys - #520
Open
faisalahammad wants to merge 1 commit into
Open
faisalahammad wants to merge 1 commit into
faisalahammad wants to merge 1 commit into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
faisalahammad
force-pushed
the
fix/508-port-copyable-list-tables
branch
from
August 14, 2026 18:32
144ce09 to
7b08cac
Compare
Ports upstream ACF 6.8.5's assets/src/js/_acf-copyable.js so the Key column on the Field Groups / Post Types / Taxonomies / Options Pages list tables becomes click-to-copy, matching the existing field-group editor behavior. The CSS for the hover copy icon and the green check on .copied was already synced from ACF 6.8.5 in WordPress#506, but was inert because no JS was emitting the .copyable markup. This PR adds the JS half and wires it into the acf.js entry bundle. The acf script handle is already enqueued on the four edit-acf-* list screens, so no PHP or CSS change is required. - assets/src/js/_acf-copyable.js (new) - acf.Model gated on pagenow matching edit-acf-field-group, edit-acf-post-type, edit-acf-taxonomy, edit-acf-ui-options-page. Finds .column-acf-key cells, wraps the key text in a span.copyable (adds copy-unsupported when navigator.clipboard is unavailable), and handles the copy click. - assets/src/js/acf.js - added import './_acf-copyable.js'; after the _acf-tooltip.js import, matching upstream's entry ordering. Fixes WordPress#508
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.
Ports upstream ACF 6.8.5's
assets/src/js/_acf-copyable.jsso the Key column on the Field Groups / Post Types / Taxonomies / Options Pages list tables becomes click-to-copy, matching the existing field-group editor behavior.The CSS for the hover copy icon and the green check on
.copiedwas already synced from ACF 6.8.5 in #506, but was inert because no JS was emitting the.copyablemarkup. This PR adds the JS half and wires it into theacf.jsentry bundle. Theacfscript handle is already enqueued on the fouredit-acf-*list screens, so no PHP or CSS change is required.Diff:
acf.Modelgated onpagenowmatchingedit-acf-field-group,edit-acf-post-type,edit-acf-taxonomy,edit-acf-ui-options-page. Finds.column-acf-keycells, wraps the key text in aspan.copyable(addscopy-unsupportedwhennavigator.clipboardis unavailable), and handles the copy click.import './_acf-copyable.js';after the_acf-tooltip.jsimport, matching upstream's entry ordering.How to test
acf.jsis checked in underassets/build/and shipped; verify locally withnpm run buildif needed).navigator.clipboardis unavailable in non-secure contexts; no JS errors.Screenshots