Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/16/2015 10:45:58 PM (6 years ago)
Author:
imath
Message:

Avatar UI: Add Ajax functions to upload/crop/capture and delete avatars. Enqueue the needed Avatar scripts and css.

bp_core_avatar_scripts() will enqueue the scripts only if editing an avatar on front-end and if the user avatar uploads are not disabled. The hooks to maximize backward theme compatibility are localized in this function.

See #6290

File:
1 edited

Legend:

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

    r9754 r9758  
    121121
    122122/**
     123 * Enqueues the css and js required by the Avatar UI
     124 *
     125 * @since  BuddyPress (2.3.0)
     126 */
     127function bp_core_avatar_scripts() {
     128    if ( ! bp_avatar_is_front_edit() ) {
     129        return false;
     130    }
     131
     132    // Enqueue the Attachments scripts for the Avatar UI
     133    bp_attachments_enqueue_scripts( 'BP_Attachment_Avatar' );
     134
     135    // Add Some actions for Theme backcompat
     136    add_action( 'bp_after_profile_avatar_upload_content', 'bp_avatar_template_check' );
     137    add_action( 'bp_after_group_admin_content',           'bp_avatar_template_check' );
     138    add_action( 'bp_after_group_avatar_creation_step',    'bp_avatar_template_check' );
     139}
     140add_action( 'bp_enqueue_scripts', 'bp_core_avatar_scripts' );
     141
     142/**
    123143 * Enqueues jCrop library and hooks BP's custom cropper JS.
    124144 */
Note: See TracChangeset for help on using the changeset viewer.