LLMS_REST_Webhooks_Controller::update_item( WP_REST_Request $request )

Update an Webhook


Parameters Parameters

$request

(WP_REST_Request) (Required) Request object.


Top ↑

Return Return

(WP_Error|WP_REST_Response)


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/server/class-llms-rest-webhooks-controller.php

	 */
	public function update_item( $request ) {

		$prepared = $this->prepare_item_for_database( $request );
		// Exclude additional fields registered via `register_rest_field()`.
		$prepared = array_diff_key( $prepared, $this->get_additional_fields() );
		$webhook  = LLMS_REST_API()->webhooks()->update( $prepared );
		if ( is_wp_error( $request ) ) {
			$request->add_data( array( 'status' => 400 ) );
			return $request;
		}

		// Fields registered via `register_rest_field()`.
		$fields_update = $this->update_additional_fields_for_object( $webhook, $request );


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.3 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.