LLMS_REST_Webhooks::update_prepare( array $data )
Prepare data for an update.
Parameters Parameters
- $data
-
(array) (Required) Associative array of data to set to a resources properties.
Return Return
(LLMS_REST_Webhook|WP_Error)
Source Source
File: libraries/lifterlms-rest/includes/class-llms-rest-webhooks.php
* @since 1.0.0-beta.1 * @since 1.0.0-beta.17 Remove reference to 'pending_delivery' (unused) column. * * @param array $data Associative array of data to set to a resources properties. * @return LLMS_REST_Webhook|WP_Error */ protected function update_prepare( $data ) { $url = isset( $data['delivery_url'] ); // Merge in (some) default values. $defaults = $this->get_default_column_values(); unset( $defaults['failure_count'] ); $data = wp_parse_args( array_filter( $data ), $defaults ); // URL was supplied but empty so add it back in to get caught by validation. if ( $url && ! isset( $data['delivery_url'] ) ) { $data['delivery_url'] = ''; } // Validate via default parent methods. $data = parent::update_prepare( $data ); if ( is_wp_error( $data ) ) { return $data; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.17 | Remove reference to 'pending_delivery' (unused) column. |
1.0.0-beta.1 | Introduced. |