mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 17:20:07 +00:00
Block Patterns: Update the value used for keywords.
Patterns on the [https://wordpress.org/patterns/ Pattern Directory] can have keywords for better discoverability while searching. The way these are stored [69548ff1f0 was changed from a taxonomy to meta value], but the `/wp/v2/pattern-directory/patterns` endpoint was still pulling from that old value.
The correct property to use for this field is `meta.wpop_keywords`, which returns a single string with comma-separated keywords.
Props ryelle, TimothyBlynJacobs.
See #56126.
git-svn-id: https://develop.svn.wordpress.org/trunk@53665 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -111,6 +111,9 @@ class WP_REST_Pattern_Directory_Controller_Test extends WP_Test_REST_Controller_
|
||||
$this->assertGreaterThan( 0, count( $patterns ) );
|
||||
|
||||
array_walk( $patterns, array( $this, 'assertPatternMatchesSchema' ) );
|
||||
$this->assertSame( array( 'blog post' ), $patterns[0]['keywords'] );
|
||||
$this->assertSame( array( 'header', 'hero' ), $patterns[1]['keywords'] );
|
||||
$this->assertSame( array( 'call to action', 'hero section' ), $patterns[2]['keywords'] );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,10 +160,6 @@ class WP_REST_Pattern_Directory_Controller_Test extends WP_Test_REST_Controller_
|
||||
$this->assertGreaterThan( 0, count( $patterns ) );
|
||||
|
||||
array_walk( $patterns, array( $this, 'assertPatternMatchesSchema' ) );
|
||||
|
||||
foreach ( $patterns as $pattern ) {
|
||||
$this->assertContains( 'core', $pattern['keywords'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user