Make WordPress Core


Ignore:
Timestamp:
09/20/2022 04:27:44 PM (3 years ago)
Author:
jorgefilipecosta
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-patterns.php

    r53943 r54263  
    190190 *   - Keywords         (comma-separated values)
    191191 *   - Block Types      (comma-separated values)
     192 *   - Post Types       (comma-separated values)
    192193 *   - Inserter         (yes/no)
    193194 *
     
    204205        'keywords'      => 'Keywords',
    205206        'blockTypes'    => 'Block Types',
     207        'postTypes'     => 'Post Types',
    206208        'inserter'      => 'Inserter',
    207209    );
     
    275277
    276278                    // For properties of type array, parse data as comma-separated.
    277                     foreach ( array( 'categories', 'keywords', 'blockTypes' ) as $property ) {
     279                    foreach ( array( 'categories', 'keywords', 'blockTypes', 'postTypes' ) as $property ) {
    278280                        if ( ! empty( $pattern_data[ $property ] ) ) {
    279281                            $pattern_data[ $property ] = array_filter(
Note: See TracChangeset for help on using the changeset viewer.