Skip to content

Commit 9ff4194

Browse files
committed
Editor: Add thumbs up and plus note reactions.
Adds πŸ‘ and βž• to the note reaction keys accepted by `WP_REST_Comments_Controller`, extending the quick reactions with two common positive responses. Thumbs down remains excluded to keep the default set positive. This brings over the PHP changes from WordPress/gutenberg#85565. Follow-up to r64488. Props mamaduka, mukesh27. See #64638. git-svn-id: https://develop.svn.wordpress.org/trunk@64999 602fd350-edb4-49c9-b593-d223f7449a82
1 parent e75b3fb commit 9ff4194

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

β€Žsrc/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.phpβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
4444
*
4545
* @since 7.2.0
4646
*
47-
* @return string[] Hex keys for heart, celebration, smile, eyes and rocket.
47+
* @return string[] Hex keys for thumbs up, plus, heart, celebration, smile, eyes and rocket.
4848
*
4949
* @phpstan-return non-empty-list<lowercase-string&non-falsy-string>
5050
*/
5151
private static function get_note_reaction_keys(): array {
52-
return array( '2764', '1f389', '1f604', '1f440', '1f680' );
52+
return array( '1f44d', '2795', '2764', '1f389', '1f604', '1f440', '1f680' );
5353
}
5454

5555
/**

β€Žtests/phpunit/tests/rest-api/rest-comments-controller.phpβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4804,6 +4804,8 @@ public function test_create_reaction_accepts_curated_key( $key ) {
48044804

48054805
public function data_curated_reaction_keys() {
48064806
return array(
4807+
'thumbs up' => array( '1f44d' ),
4808+
'plus' => array( '2795' ),
48074809
'2764' => array( '2764' ),
48084810
'celebration' => array( '1f389' ),
48094811
'smile' => array( '1f604' ),
@@ -4985,7 +4987,7 @@ public function test_create_reaction_rejects_uncurated_key( $key ) {
49854987

49864988
public function data_uncurated_reaction_keys() {
49874989
return array(
4988-
'uncurated emoji' => array( '1f44d' ),
4990+
'uncurated emoji' => array( '1f525' ),
49894991
'ZWJ sequence' => array( '1f468-200d-1f4bb' ),
49904992
'with variation selector' => array( '2764-fe0f' ),
49914993
'uppercase key' => array( '1F680' ),

0 commit comments

Comments
Β (0)