rest_after_save_widget WordPress Action Hook

The rest_after_save_widget hook is called after a widget is saved via the REST API. This hook gives developers an opportunity to perform an action after a widget is saved. This is useful for tasks such as logging or sending a notification.

do_action( 'rest_after_save_widget', string $id, string $sidebar_id, WP_REST_Request $request, bool $creating ) #

Fires after a widget is created or updated via the REST API.


Parameters

$id

(string)ID of the widget being saved.

$sidebar_id

(string)ID of the sidebar containing the widget being saved.

$request

(WP_REST_Request)Request object.

$creating

(bool)True when creating a widget, false when updating.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.