bp_nouveau_prepare_group_for_js( $item )

Format a Group for a json reply

Description

Source

File: bp-templates/bp-nouveau/includes/groups/functions.php

448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
function bp_nouveau_prepare_group_for_js( $item ) {
    if ( empty( $item->id ) ) {
        return array();
    }
 
    $item_avatar_url = bp_core_fetch_avatar( array(
        'item_id'    => $item->id,
        'object'     => 'group',
        'type'       => 'thumb',
        'html'       => false
    ) );
 
    return array(
        'id'          => $item->id,
        'name'        => $item->name,
        'avatar_url'  => $item_avatar_url,
        'object_type' => 'group',
        'is_public'   => ( 'public' === $item->status ),
    );
}

Changelog

Changelog
Version Description
BuddyPress 3.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.