Skip to content

Commit d605dbc

Browse files
authored
Fix the category_slugs format in the Patterns API
This fixes a regression caused via #704 that returns category_slugs as an object instead of an array
1 parent 060ed90 commit d605dbc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

public_html/wp-content/plugins/pattern-directory/includes/pattern-post-type.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ function register_rest_fields() {
295295
$slugs = wp_list_pluck( wp_get_object_terms( get_the_ID(), 'wporg-pattern-category' ), 'slug' );
296296
$slugs = array_map( 'sanitize_title', $slugs );
297297
$slugs = array_diff( $slugs, [ 'featured' ] );
298+
$slugs = array_values( $slugs );
298299

299300
return $slugs;
300301
},

0 commit comments

Comments
 (0)