LLMS_REST_Webhooks::save( LLMS_REST_Webhook $obj, array $data )

Persist data.


Description Description

This method assumes the supplied data has already been validated and sanitized.


Top ↑

Parameters Parameters

$obj

(LLMS_REST_Webhook) (Required) Webhook object.

$data

(array) (Required) Associative array of data to persist.


Top ↑

Return Return

(obj)


Top ↑

Source Source

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

	protected function save( $obj, $data ) {

		if ( isset( $data['delivery_url'] ) && ( ! $obj->exists() || $obj->exists() && $data['delivery_url'] !== $obj->get( 'delivery_url' ) ) ) {
			$obj->set( 'delivery_url', $data['delivery_url'] );
			$ping = $obj->ping();
			if ( is_wp_error( $ping ) ) {
				return $ping;
			}
		}

		$obj->setup( $data )->save();
		return $obj;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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