bp_dd_delete_avatar( $args )
Delete avatar of group and user
Description
Parameters
- $args
-
(Required)
Source
File: bp-core/bp-core-filters.php
function bp_dd_delete_avatar( $args ) {
$item_id = ! empty( $args['item_id'] ) ? absint( $args['item_id'] ) : 0;
if ( ! empty( $item_id ) ) {
// check for user avatars getting deleted
if ( isset( $args['object'] ) && 'user' == $args['object'] ) {
bp_delete_user_meta( $item_id, 'avatars' );
}
// check for group avatars getting deleted
if ( isset( $args['object'] ) && 'group' == $args['object'] ) {
groups_delete_groupmeta( $item_id, 'avatars' );
}
}
}
Changelog
| Version | Description |
|---|---|
| BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.