Resolves conflict with custom link class UI added in wp 69#22822
Resolves conflict with custom link class UI added in wp 69#22822
Conversation
…flict-with-custom-link-class-ui-added-in-wp-69
Pull Request Test Coverage Report for Build b2253d7230b0746e5ffcf3aed0b4cac30b178d85Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Pull request overview
This PR fixes a compatibility issue between Yoast SEO and WordPress 6.9's new link class attribute feature. WordPress 6.9 introduced custom link classes via the LinkControl component, but Yoast's custom link format definition was missing this attribute, causing the LinkControl to malfunction when Yoast SEO was active.
Key Changes:
- Extended the link format definition to include
type,id, andclassattributes to match WordPress core's link format - Added
hasTextControl={true}prop to LinkControl component to explicitly enable text editing - Refactored link update logic to properly handle text changes using WordPress's recommended remove/insert pattern
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/js/src/inline-links/edit-link.js | Added type, id, and class attributes to link format definition |
| packages/js/src/inline-links/utils.js | Extended createLinkFormat function to support new attributes |
| packages/js/src/inline-links/inline.js | Refactored link handling logic and added hasTextControl prop |
| packages/js/tests/inline-links/utils.test.js | Added comprehensive unit tests for the updated utility functions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Context
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Relevant test scenarios
Test instructions for QA when the code is in the RC
QA can test this PR by following these steps:
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.Documentation
Quality assurance
grunt build:imagesand commited the results, if my PR introduces new images or SVGs.Innovation
innovationlabel.Fixes #22705