Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#49270 closed enhancement (fixed)

Add color format to REST API validation

Reported by: spacedmonkey's profile spacedmonkey Owned by: spacedmonkey's profile spacedmonkey
Milestone: 5.5 Priority: normal
Severity: normal Version: 4.4
Component: REST API Keywords: has-patch
Focuses: rest-api Cc:

Description

Add validation for color as a formatted type in REST API requests.

Attachments (4)

49270.diff (1.5 KB) - added by spacedmonkey 5 years ago.
49270.2.diff (1.4 KB) - added by spacedmonkey 5 years ago.
49270.3.diff (3.8 KB) - added by spacedmonkey 5 years ago.
49270.4.diff (4.5 KB) - added by spacedmonkey 5 years ago.

Download all attachments as: .zip

Change History (11)

@spacedmonkey
5 years ago

This ticket was mentioned in PR #140 on WordPress/wordpress-develop by spacedmonkey.


5 years ago
#1

This ticket was mentioned in PR #141 on WordPress/wordpress-develop by spacedmonkey.


5 years ago
#2

@spacedmonkey
5 years ago

#3 @chrisvanpatten
5 years ago

I dig this a lot but it should probably be named "hex color" or something like that, to distinguish it from other valid color types (rgb, rgba, hsl, etc)

#4 @TimothyBlynJacobs
5 years ago

  • Milestone changed from Awaiting Review to Future Release

This looks great! I agree with @chrisvanpatten about naming to make it clear this is a hex color format.

@spacedmonkey
5 years ago

#5 @spacedmonkey
5 years ago

Thanks for the feedback. In 49270.4.diff, I change naming to hex-color and added tests.

You can also posts comments on PR here.

Last edited 5 years ago by spacedmonkey (previous) (diff)

@spacedmonkey
5 years ago

#6 @TimothyBlynJacobs
5 years ago

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

In 47450:

REST API: Introduce "hex-color" JSON Schema format.

Props spacedmonkey, chrisvanpatten.
Fixes #49270.

#7 @TimothyBlynJacobs
5 years ago

  • Milestone changed from Future Release to 5.5
Note: See TracTickets for help on using tickets.