Создать пресет
POST
/wp-json/wp2/elementor-style-presets/v1/presets
const url = 'https://example.com/wp-json/wp2/elementor-style-presets/v1/presets';const options = { method: 'POST', headers: {'X-WP-Nonce': '<X-WP-Nonce>', 'Content-Type': 'application/json'}, body: '{"widget_type":"example","name":"example","settings":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/wp-json/wp2/elementor-style-presets/v1/presets \ --header 'Content-Type: application/json' \ --header 'X-WP-Nonce: <X-WP-Nonce>' \ --data '{ "widget_type": "example", "name": "example", "settings": "example" }'Создаёт или обновляет пресет: widget_type, name и settings (JSON-строка настроек виджета).
Authorizations
Заголовок раздела «Authorizations»Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Media typeapplication/json
object
widget_type
required
Тип виджета Elementor.
string
name
required
Человекочитаемое имя.
string
settings
required
JSON string
string
Example
{ "widget_type": "example", "name": "example", "settings": "example"}Responses
Заголовок раздела «Responses»OK
Media typeapplication/json
object
id
Числовой идентификатор сущности.
integer
name
Человекочитаемое имя.
string
widget_type
Тип виджета Elementor.
string
settings
Настройки пресета (JSON-строка).
object
Examplegenerated
{ "id": 1, "name": "example", "widget_type": "example", "settings": {}}Не аутентифицирован. WordPress REST: rest_not_logged_in / rest_forbidden. Cookie + X-WP-Nonce или Application Password.
Media typeapplication/json
object
code
Машинный код ошибки или события.
string
message
Текст сообщения (лог, PIN, сброс пароля).
string
data
Дополнительные данные WP_Error или лицензии.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Нет права или невалидный REST nonce. WordPress REST: rest_forbidden / rest_cookie_invalid_nonce.
Media typeapplication/json
object
code
Машинный код ошибки или события.
string
message
Текст сообщения (лог, PIN, сброс пароля).
string
data
Дополнительные данные WP_Error или лицензии.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}