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.
Parameters Parameters
- $obj
-
(LLMS_REST_Webhook) (Required) Webhook object.
- $data
-
(array) (Required) Associative array of data to persist.
Return Return
(obj)
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;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0-beta.1 | Introduced. |