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

	 * @since 1.0.0-beta.1
	 *
	 * @param LLMS_REST_Webhook $obj Webhook object.
	 * @param array             $data Associative array of data to persist.
	 * @return obj
	 */
	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;
			}


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.