Make WordPress Core

Opened 16 months ago

Closed 16 months ago

Last modified 15 months ago

#58597 closed enhancement (fixed)

Allow non-block themes to add theme support for link color settings

Reported by: poena's profile poena Owned by: audrasjb's profile audrasjb
Milestone: 6.3 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch has-screenshots commit needs-docs has-dev-note
Focuses: Cc:

Description (last modified by poena)

Allow themes without theme.json to opt-in to block link color tools via:

add_theme_support( 'link-color' );

Follow up to https://core.trac.wordpress.org/ticket/57460 and https://core.trac.wordpress.org/ticket/57649 with a more limited scope than 'appearance-tools'.

Corresponding Gutenberg PR: https://github.com/WordPress/gutenberg/pull/51775

Attachments (3)

58597.diff (736 bytes) - added by poena 16 months ago.
Updates theme support in wp-includes/class-wp-theme-json-resolver.php
Capture d’écran 2023-06-22 à 13.43.16.png (157.8 KB) - added by audrasjb 16 months ago.
Before patch: no support for link's custom styles
Capture d’écran 2023-06-22 à 13.43.34.png (204.6 KB) - added by audrasjb 16 months ago.
After patch: wooohooo \o/

Download all attachments as: .zip

Change History (11)

@poena
16 months ago

Updates theme support in wp-includes/class-wp-theme-json-resolver.php

#1 @poena
16 months ago

Testing instructions

Activate a classic theme.

Open the themes functions.php and locate a setup function or similar that uses
add_action( 'after_setup_theme'. For example, if you are using Twenty Twenty-One, look for the function called
twenty_twenty_one_setup()

Add add_theme_support( 'link-color' ); inside that function.
Open the block editor.
Add a paragraph with a link.
Open the block settings sidebar and confirm that the link option is available in the color panel.

Select a custom link color using the color picker. Confirm that the color works in the editor and the front.

(I am suggesting the color picker because themes need to add their own CSS to make the custom theme palette colors work)

#2 @poena
16 months ago

  • Description modified (diff)

#3 @poena
16 months ago

  • Component changed from General to Themes
  • Keywords has-patch added

@audrasjb
16 months ago

Before patch: no support for link's custom styles

@audrasjb
16 months ago

After patch: wooohooo \o/

#4 @audrasjb
16 months ago

  • Keywords has-screenshots commit added

Thanks for the ticket and patch Carolina!

Tested on my side using a classic theme: works fine!

Self assigning for commit.

#5 @audrasjb
16 months ago

  • Keywords needs-dev-note needs-docs added

#6 @audrasjb
16 months ago

  • Owner set to audrasjb
  • Status changed from new to accepted

#7 @audrasjb
16 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 55996:

Themes: Allow non-block themes to add theme support for link color settings.

This changeset themes without theme.json to opt-in to block link color tools via add_theme_support( 'link-color' );.

Follow-up to [55067], [55273].

Props poena, audrasjb.
Fixes #58597.

#8 @stevenlinx
15 months ago

  • Keywords has-dev-note added; needs-dev-note removed
Note: See TracTickets for help on using tickets.