Skip to content

Commit

Permalink
add missing case for 'post-format'
Browse files Browse the repository at this point in the history
  • Loading branch information
petitphp committed Feb 9, 2024
1 parent 977e601 commit 7354aec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions lib/compat/wordpress-6.6/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ function _gutenberg_get_search_result_label_field( $result_object, $field_name,
$term = get_term_by( 'term_taxonomy_id', $object_id );
$label = $term && ! is_wp_error( $term ) ? get_taxonomy( $term->taxonomy )->labels->singular_name : '';
break;
case 'post-format':
$label = get_post_format_string( $object_id );
break;
default:
$label = '';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ jest.mock( '@wordpress/api-fetch', () =>
url: 'http://wordpress.local/type/gallery/',
type: 'post-format',
kind: 'taxonomy',
label: 'post-format',
label: 'Gallery',
},
{
id: 'quote',
title: 'Quote',
url: 'http://wordpress.local/type/quote/',
type: 'post-format',
kind: 'taxonomy',
label: 'post-format',
label: 'Quote',
},
] );
case '/wp/v2/search?search=&per_page=3&type=post&subtype=page':
Expand Down Expand Up @@ -157,15 +157,15 @@ describe( 'fetchLinkSuggestions', () => {
url: 'http://wordpress.local/type/gallery/',
type: 'post-format',
kind: 'taxonomy',
label: 'post-format',
label: 'Gallery',
},
{
id: 'quote',
title: 'Quote',
url: 'http://wordpress.local/type/quote/',
type: 'post-format',
kind: 'taxonomy',
label: 'post-format',
label: 'Quote',
},
] )
);
Expand Down Expand Up @@ -230,15 +230,15 @@ describe( 'fetchLinkSuggestions', () => {
url: 'http://wordpress.local/type/gallery/',
type: 'post-format',
kind: 'taxonomy',
label: 'post-format',
label: 'Gallery',
},
{
id: 'quote',
title: 'Quote',
url: 'http://wordpress.local/type/quote/',
type: 'post-format',
kind: 'taxonomy',
label: 'post-format',
label: 'Quote',
},
{
id: 54,
Expand Down

0 comments on commit 7354aec

Please sign in to comment.