Skip to content

Commit

Permalink
Fix the category_slugs format in the Patterns API
Browse files Browse the repository at this point in the history
This fixes a regression caused via #704 that returns category_slugs as an object instead of an array
  • Loading branch information
ParhamG authored Oct 1, 2024
1 parent 060ed90 commit d605dbc
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ function register_rest_fields() {
$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' ] );
$slugs = array_values( $slugs );

return $slugs;
},
Expand Down

0 comments on commit d605dbc

Please sign in to comment.