Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link color theme_support #51775

Merged
merged 2 commits into from Jun 28, 2023
Merged

Add link color theme_support #51775

merged 2 commits into from Jun 28, 2023

Conversation

carolinan
Copy link
Contributor

@carolinan carolinan commented Jun 22, 2023

What?

This PR adds theme support for the link color settings.

Update: This core patch has been committed https://core.trac.wordpress.org/ticket/58597


Closes #41857, replaces #47675
Alternative to #47451

Related:
Core ticket and patch https://core.trac.wordpress.org/ticket/58597

core 57460 Backport: appearance-tools theme_support
core 56487 Bundled themes: opt-in to appearance tools

Why?

There is no way for themes to enable link color settings without theme.json (Theme.json can not be added to all classic themes without friction).

How?

Adds a conditional check, and if the theme or plugin adds add_theme_support( 'link-color' ); enables the setting in the block editor.

Testing Instructions

In your WordPress install, make sure that WP_DEBUG_DISPLAY, WP_DEBUG are set to true.
Activate Twenty Twenty-One.
You should see a doing it wrong message about experimental-link-color.
In your code editor, open functions.php in Twenty Twenty-One.
Around line 333, remove
add_theme_support( 'experimental-link-color' );

And add:

add_theme_support( 'link-color' );

On refresh, the doing it wrong notice should no longer show.

Create a new post.
Add a link to a paragraph block.
Confirm that the paragraph has a link color setting. Select a custom link color and confirm that it works.

Palette colors will not work on the front, that is a separate issue:
There are known bugs in Twenty Twenty-One that needs to be solved, you do not need to test them as part of this PR,
the main goal is to confirm that the controls are available.

Screenshots or screencast

@carolinan carolinan marked this pull request as ready for review June 22, 2023 03:35
@carolinan carolinan added [Type] Enhancement A suggestion for improvement. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. labels Jun 22, 2023
@aristath aristath requested a review from Mamaduka June 22, 2023 05:54
@github-actions
Copy link

Flaky tests detected in e5f10e0.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5352975847
📝 Reported issues:

@carolinan carolinan added the Backport from WordPress Core Pull request that needs to be backported to the a Gutenberg release from WordPress Core label Jun 26, 2023
Copy link
Member

@aristath aristath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has already been merged in Core, approving the PR so it can be merged in Gutenberg as well. 👍

@aristath aristath merged commit d8e8c28 into trunk Jun 28, 2023
50 checks passed
@aristath aristath deleted the add/link-color-theme-support branch June 28, 2023 08:25
@github-actions github-actions bot added this to the Gutenberg 16.2 milestone Jun 28, 2023
sethrubenstein pushed a commit to pewresearch/gutenberg that referenced this pull request Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport from WordPress Core Pull request that needs to be backported to the a Gutenberg release from WordPress Core [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.
Projects
Development

Successfully merging this pull request may close these issues.

Consider re-adding link color support for classic themes
2 participants