BP_Optout::delete( array $args = array() )
Delete opt-outs.
Contents
Description Description
See also See also
- BP_optout::get(): for a description of accepted where arguments.
Parameters Parameters
- $args
-
(array) (Optional) Associative array of columns/values, to determine which rows should be deleted. Of the format array( 'user_id' => 7, 'email_address' => 'bar@foo.com', ).
Default value: array()
Return Return
(int|bool) Number of rows deleted on success, false on failure.
Source Source
File: bp-core/classes/class-bp-optout.php
public static function delete( $args = array() ) { $where = self::get_query_clauses( $args ); /** * Fires before an opt-out is deleted. * * @since 8.0.0 * * @param array $args Characteristics of the opt-outs to be deleted. */ do_action( 'bp_optout_before_delete', $args ); // Clear matching items from the cache. $cache_args = $args; $cache_args['fields'] = 'ids'; $maybe_cached_ids = self::get( $cache_args ); foreach ( $maybe_cached_ids as $invite_id ) { wp_cache_delete( $invite_id, 'bp_optouts' ); } $retval = self::_delete( $where['data'], $where['format'] ); /** * Fires after an opt-out is deleted. * * @since 8.0.0 * * @param array $args Characteristics of the opt-outs just deleted. */ do_action( 'bp_optout_after_delete', $args ); return $retval; }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
8.0.0 | Introduced. |