Changeset 53675
- Timestamp:
- 07/06/2022 04:26:08 PM (2 years ago)
- Location:
- branches/5.8
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.8
-
branches/5.8/src/wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php
r51317 r53675 211 211 'content' => wp_kses_post( $raw_pattern->pattern_content ), 212 212 'categories' => array_map( 'sanitize_title', $raw_pattern->category_slugs ), 213 'keywords' => array_map( 'sanitize_t itle', $raw_pattern->keyword_slugs),213 'keywords' => array_map( 'sanitize_text_field', explode( ',', $raw_pattern->meta->wpop_keywords ) ), 214 214 'description' => sanitize_text_field( $raw_pattern->meta->wpop_description ), 215 215 'viewport_width' => absint( $raw_pattern->meta->wpop_viewport_width ), … … 279 279 280 280 'keywords' => array( 281 'description' => __( "The pattern's keyword slugs." ),281 'description' => __( "The pattern's keywords." ), 282 282 'type' => 'array', 283 283 'uniqueItems' => true, -
branches/5.8/tests/phpunit/data/blocks/pattern-directory/browse-all.json
r51021 r53675 10 10 "spay_email": "", 11 11 "wpop_description": "A heading preceded by a chapter number, and followed by a paragraph.", 12 "wpop_keywords": "blog post", 12 13 "wpop_viewport_width": 1000 13 14 }, … … 26 27 "spay_email": "", 27 28 "wpop_description": "A large hero section with an example background image and a heading in the center.", 29 "wpop_keywords": "header, hero", 28 30 "wpop_viewport_width": 1000 29 31 }, … … 42 44 "spay_email": "", 43 45 "wpop_description": "A large hero section with a bright gradient background, a big heading and a filled button.", 46 "wpop_keywords": "call to action, hero section", 44 47 "wpop_viewport_width": 1000 45 48 }, -
branches/5.8/tests/phpunit/data/blocks/pattern-directory/browse-category-2.json
r51021 r53675 10 10 "spay_email": "", 11 11 "wpop_description": "Three filled buttons with rounded corners, side by side.", 12 "wpop_keywords": "", 12 13 "wpop_viewport_width": 600 13 14 }, … … 26 27 "spay_email": "", 27 28 "wpop_description": "Two buttons, one filled and one outlined, side by side.", 29 "wpop_keywords": "", 28 30 "wpop_viewport_width": 500 29 31 }, -
branches/5.8/tests/phpunit/data/blocks/pattern-directory/browse-keyword-11.json
r51021 r53675 10 10 "spay_email": "", 11 11 "wpop_description": "A heading preceded by a chapter number, and followed by a paragraph.", 12 "wpop_keywords": "", 12 13 "wpop_viewport_width": 1000 13 14 }, … … 26 27 "spay_email": "", 27 28 "wpop_description": "A large hero section with an example background image and a heading in the center.", 29 "wpop_keywords": "", 28 30 "wpop_viewport_width": 1000 29 31 }, … … 42 44 "spay_email": "", 43 45 "wpop_description": "A large hero section with a bright gradient background, a big heading and a filled button.", 46 "wpop_keywords": "", 44 47 "wpop_viewport_width": 1000 45 48 }, -
branches/5.8/tests/phpunit/data/blocks/pattern-directory/search-button.json
r51021 r53675 10 10 "spay_email": "", 11 11 "wpop_description": "A large hero section with a bright gradient background, a big heading and a filled button.", 12 "wpop_keywords": "", 12 13 "wpop_viewport_width": 1000 13 14 }, … … 26 27 "spay_email": "", 27 28 "wpop_description": "Three small columns of text, each with an outlined button with rounded corners at the bottom.", 29 "wpop_keywords": "", 28 30 "wpop_viewport_width": 1000 29 31 }, … … 42 44 "spay_email": "", 43 45 "wpop_description": "Three filled buttons with rounded corners, side by side.", 46 "wpop_keywords": "", 44 47 "wpop_viewport_width": 600 45 48 }, … … 58 61 "spay_email": "", 59 62 "wpop_description": "Two buttons, one filled and one outlined, side by side.", 63 "wpop_keywords": "", 60 64 "wpop_viewport_width": 500 61 65 }, -
branches/5.8/tests/phpunit/tests/rest-api/rest-pattern-directory-controller.php
r51208 r53675 101 101 102 102 array_walk( $patterns, array( $this, 'assertPatternMatchesSchema' ) ); 103 $this->assertSame( array( 'blog post' ), $patterns[0]['keywords'] ); 104 $this->assertSame( array( 'header', 'hero' ), $patterns[1]['keywords'] ); 105 $this->assertSame( array( 'call to action', 'hero section' ), $patterns[2]['keywords'] ); 103 106 } 104 107 … … 147 150 148 151 array_walk( $patterns, array( $this, 'assertPatternMatchesSchema' ) ); 149 150 foreach ( $patterns as $pattern ) {151 $this->assertContains( 'core', $pattern['keywords'] );152 }153 152 } 154 153
Note: See TracChangeset
for help on using the changeset viewer.