mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 10:44:26 +00:00
Editor: Add post types property to wp-rest-block-patterns-controller.php.
Backports PHP changes in WordPress/gutenberg#41791 to the core. Adds the post types property to the rest API patterns endpoint. Props mcsf, ntsekouras, matveb. See #56467. git-svn-id: https://develop.svn.wordpress.org/trunk@54263 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -189,6 +189,7 @@ function _register_remote_theme_patterns() {
|
||||
* - Categories (comma-separated values)
|
||||
* - Keywords (comma-separated values)
|
||||
* - Block Types (comma-separated values)
|
||||
* - Post Types (comma-separated values)
|
||||
* - Inserter (yes/no)
|
||||
*
|
||||
* @since 6.0.0
|
||||
@@ -203,6 +204,7 @@ function _register_theme_block_patterns() {
|
||||
'categories' => 'Categories',
|
||||
'keywords' => 'Keywords',
|
||||
'blockTypes' => 'Block Types',
|
||||
'postTypes' => 'Post Types',
|
||||
'inserter' => 'Inserter',
|
||||
);
|
||||
|
||||
@@ -274,7 +276,7 @@ function _register_theme_block_patterns() {
|
||||
}
|
||||
|
||||
// For properties of type array, parse data as comma-separated.
|
||||
foreach ( array( 'categories', 'keywords', 'blockTypes' ) as $property ) {
|
||||
foreach ( array( 'categories', 'keywords', 'blockTypes', 'postTypes' ) as $property ) {
|
||||
if ( ! empty( $pattern_data[ $property ] ) ) {
|
||||
$pattern_data[ $property ] = array_filter(
|
||||
preg_split(
|
||||
|
||||
Reference in New Issue
Block a user