Skip to:
Content

BuddyPress.org

Changeset 10191


Ignore:
Timestamp:
10/05/2015 10:55:15 PM (8 years ago)
Author:
imath
Message:

Cover Image: Add an action hook once the cover image has been set for the object.

Use add_action( "xprofile_cover_image_uploaded", "my_function" ) or add_action( "groups_cover_image_uploaded", "my_function" ) to run some code once the cover image was uploaded for the user or the group.

See #6570

File:
1 edited

Legend:

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

    r10189 r10191  
    10661066    $name = trim( substr( $name, 0, - ( 1 + strlen( $name_parts['extension'] ) ) ) );
    10671067
     1068    /**
     1069     * Fires if the new cover image was successfully uploaded.
     1070     *
     1071     * The dynamic portion of the hook will be xprofile in case of a user's
     1072     * cover image, groups in case of a group's cover image. For instance:
     1073     * Use add_action( 'xprofile_cover_image_uploaded' ) to run your specific
     1074     * code once the user has set his cover image.
     1075     *
     1076     * @since 2.4.0
     1077     *
     1078     * @param int $item_id Inform about the item id the cover image was set for.
     1079     */
     1080    do_action( $object_data['component'] . '_cover_image_uploaded', (int) $bp_params['item_id'] );
     1081
    10681082    // Finally return the cover image url to the UI
    10691083    bp_attachments_json_response( true, $is_html4, array(
Note: See TracChangeset for help on using the changeset viewer.