Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/29/2016 08:26:59 PM (7 years ago)
Author:
boonebgorges
Message:

Fire an action when a cover image is deleted.

The new {$component}_cover_image_deleted action provides
parity with the existing {$component}_cover_image_uploaded
action.

Props jdgrimes.
Fixes #7409.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-attachments.php

    r11289 r11357  
    14241424    // Handle delete.
    14251425    if ( bp_attachments_delete_file( array( 'item_id' => $cover_image_data['item_id'], 'object_dir' => $dir, 'type' => 'cover-image' ) ) ) {
     1426        /**
     1427         * Fires if the cover image was successfully deleted.
     1428         *
     1429         * The dynamic portion of the hook will be xprofile in case of a user's
     1430         * cover image, groups in case of a group's cover image. For instance:
     1431         * Use add_action( 'xprofile_cover_image_deleted' ) to run your specific
     1432         * code once the user has deleted his cover image.
     1433         *
     1434         * @since 2.8.0
     1435         *
     1436         * @param int $item_id Inform about the item id the cover image was deleted for.
     1437         */
     1438        do_action( "{$component}_cover_image_deleted", (int) $cover_image_data['item_id'] );
    14261439
    14271440        // Defaults no cover image.
Note: See TracChangeset for help on using the changeset viewer.