/**
 * Enqueues the css and js required by the Avatar UI.
 *
 * @since  2.3.0
 */
function bp_core_avatar_scripts()
{
    if (!bp_avatar_is_front_edit()) {
        return false;
    }
    // Enqueue the Attachments scripts for the Avatar UI.
    bp_attachments_enqueue_scripts('BP_Attachment_Avatar');
    // Add Some actions for Theme backcompat.
    add_action('bp_after_profile_avatar_upload_content', 'bp_avatar_template_check');
    add_action('bp_after_group_admin_content', 'bp_avatar_template_check');
    add_action('bp_after_group_avatar_creation_step', 'bp_avatar_template_check');
}
Example #2
0
/**
 * Trick to check if the theme's BuddyPress templates are up to date.
 *
 * If the "avatar templates" are not including the new template tag, this will
 * help users to get the avatar UI.
 *
 * @since  2.3.0
 */
function bp_avatar_template_check()
{
    if (!bp_avatar_is_front_edit()) {
        return;
    }
    if (!did_action('bp_attachments_avatar_check_template')) {
        bp_attachments_get_template_part('avatars/index');
    }
}