Block Types
Schema
The schema defines all the fields that exist within a block type record. Any response from these endpoints can be expected to contain the fields below unless the `_filter` query parameter is used or the schema field only appears in a specific context.
api_version |
Version of block API.
JSON data type: integer Read only Context: |
title |
Title of block type.
JSON data type: string Read only Context: |
name |
Unique name identifying the block type.
JSON data type: string Read only Context: |
description |
Description of block type.
JSON data type: string Read only Context: |
icon |
Icon of block type.
JSON data type: string or null Read only Context: |
attributes |
Block attributes.
JSON data type: object or null Read only Context: |
provides_context |
Context provided by blocks of this type.
JSON data type: object Read only Context: |
uses_context |
Context values inherited by blocks of this type.
JSON data type: array Read only Context: |
selectors |
Custom CSS selectors.
JSON data type: object Read only Context: |
supports |
Block supports.
JSON data type: object Read only Context: |
category |
Block category.
JSON data type: string or null Read only Context: |
is_dynamic |
Is the block dynamically rendered.
JSON data type: boolean Read only Context: |
editor_script_handles |
Editor script handles.
JSON data type: array Read only Context: |
script_handles |
Public facing and editor script handles.
JSON data type: array Read only Context: |
view_script_handles |
Public facing script handles.
JSON data type: array Read only Context: |
editor_style_handles |
Editor style handles.
JSON data type: array Read only Context: |
style_handles |
Public facing and editor style handles.
JSON data type: array Read only Context: |
styles |
Block style variations.
JSON data type: array Read only Context: |
variations |
Block variations.
JSON data type: array Read only Context: |
textdomain |
Public text domain.
JSON data type: string or null Read only Context: |
parent |
Parent blocks.
JSON data type: array or null Read only Context: |
ancestor |
Ancestor blocks.
JSON data type: array or null Read only Context: |
keywords |
Block keywords.
JSON data type: array Read only Context: |
example |
Block example.
JSON data type: object or null Read only Context: |
editor_script |
Editor script handle. DEPRECATED: Use `editor_script_handles` instead.
JSON data type: string or null Read only Context: |
script |
Public facing and editor script handle. DEPRECATED: Use `script_handles` instead.
JSON data type: string or null Read only Context: |
view_script |
Public facing script handle. DEPRECATED: Use `view_script_handles` instead.
JSON data type: string or null Read only Context: |
editor_style |
Editor style handle. DEPRECATED: Use `editor_style_handles` instead.
JSON data type: string or null Read only Context: |
style |
Public facing and editor style handle. DEPRECATED: Use `style_handles` instead.
JSON data type: string or null Read only Context: |
Retrieve a Block Type
Definition & Example Request
GET /wp/v2/block-types
Query this endpoint to retrieve a specific block type record.
$ curl https://example.com/wp-json/wp/v2/block-types
Arguments
context |
Scope under which the request is made; determines fields present in response.
Default: One of: |
namespace |
Block namespace. |
Retrieve a Block Type
Definition & Example Request
GET /wp/v2/block-types/<namespace>
Query this endpoint to retrieve a specific block type record.
$ curl https://example.com/wp-json/wp/v2/block-types/<namespace>
Arguments
context |
Scope under which the request is made; determines fields present in response.
Default: One of: |
namespace |
Block namespace. |
Retrieve a Block Type
Definition & Example Request
GET /wp/v2/block-types/<namespace>/<name>
Query this endpoint to retrieve a specific block type record.
$ curl https://example.com/wp-json/wp/v2/block-types/<namespace>/<name>
Arguments
name |
Block name. |
namespace |
Block namespace. |
context |
Scope under which the request is made; determines fields present in response.
Default: One of: |
谢谢你的反馈!