Make WordPress Core

Changeset 53210


Ignore:
Timestamp:
04/19/2022 09:39:42 AM (23 months ago)
Author:
gziolo
Message:

REST API: Add inserter field to the schema of Patterns endpoint

Backports changes from https://github.com/WordPress/gutenberg/pull/40416. Adds the missing inserter field to the Patterns item schema. This field was omitted from the response, and patterns that should be hidden in the inserter were visible.

Props mamaduka, ndiego.
See #55567.
Follow-up [53152].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php

    r53209 r53210  
    128128            'keywords'      => 'keywords',
    129129            'content'       => 'content',
     130            'inserter'      => 'inserter',
    130131        );
    131132        $data   = array();
     
    203204                    'context'     => array( 'view', 'edit', 'embed' ),
    204205                ),
     206                'inserter'       => array(
     207                    'description' => __( 'Determines whether the pattern is visible in inserter.' ),
     208                    'type'        => 'boolean',
     209                    'readonly'    => true,
     210                    'context'     => array( 'view', 'edit', 'embed' ),
     211                ),
    205212            ),
    206213        );
Note: See TracChangeset for help on using the changeset viewer.