跳转到主要内容

Widget Types

Schema

The schema defines all the fields that exist within a widget 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.

id

Unique slug identifying the widget type.

JSON data type: string

Read only

Context: embed, view, edit

name

Human-readable name identifying the widget type.

JSON data type: string

Read only

Context: embed, view, edit

description

Description of the widget.

JSON data type: string

Context: view, edit, embed

is_multi

Whether the widget supports multiple instances

JSON data type: boolean

Read only

Context: view, edit, embed

classname

Class name

JSON data type: string

Read only

Context: embed, view, edit

</div>

Retrieve a Widget Type

	<h3>Definition & Example Request</h3>

	<code>GET /wp/v2/widget-types</code>

	<p>Query this endpoint to retrieve a specific widget type record.</p>

	<code>$ curl https://example.com/wp-json/wp/v2/widget-types</code>
</div>
<div class="secondary">
		<h3>Arguments</h3>
<table class="arguments">
				<tr>
			<td>
										<code>context</code><br />
								</td>
			<td>
										<p>Scope under which the request is made; determines fields present in response.</p>
																				<p class="default">
						Default: <code>view</code>
					</p>
															<p>One of: <code>view</code>, <code>embed</code>, <code>edit</code></p>
								</td>
		</tr>
		</table>

</div>

Retrieve a Widget Type

	<h3>Definition & Example Request</h3>

	<code>GET /wp/v2/widget-types/&lt;id&gt;</code>

	<p>Query this endpoint to retrieve a specific widget type record.</p>

	<code>$ curl https://example.com/wp-json/wp/v2/widget-types/&lt;id&gt;</code>
</div>
<div class="secondary">
		<h3>Arguments</h3>
<table class="arguments">
				<tr>
			<td>
										<code>id</code><br />
								</td>
			<td>
										<p>The widget type id.</p>
																							</td>
		</tr>
				<tr>
			<td>
										<code>context</code><br />
								</td>
			<td>
										<p>Scope under which the request is made; determines fields present in response.</p>
																				<p class="default">
						Default: <code>view</code>
					</p>
															<p>One of: <code>view</code>, <code>embed</code>, <code>edit</code></p>
								</td>
		</tr>
		</table>

</div>