Skip to content

Commit

Permalink
Patterns API: Omit the "featured" category in the REST API (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelle authored Sep 30, 2024
1 parent e8c04be commit 060ed90
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,10 @@ function register_rest_fields() {
array(
'get_callback' => function() {
$slugs = wp_list_pluck( wp_get_object_terms( get_the_ID(), 'wporg-pattern-category' ), 'slug' );
$slugs = array_map( 'sanitize_title', $slugs );
$slugs = array_diff( $slugs, [ 'featured' ] );

return array_map( 'sanitize_title', $slugs );
return $slugs;
},

'schema' => array(
Expand Down

0 comments on commit 060ed90

Please sign in to comment.