bp_nouveau_ajax_document_get_folder_view()

Description

Source

File: bp-templates/bp-nouveau/includes/document/ajax.php

1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
function bp_nouveau_ajax_document_get_folder_view() {
 
    $type = filter_input( INPUT_POST, 'type', FILTER_SANITIZE_STRING );
    $id   = filter_input( INPUT_POST, 'id', FILTER_SANITIZE_STRING );
 
    if ( 'profile' === $type ) {
        $ul = bp_document_user_document_folder_tree_view_li_html( $id, 0 );
    } else {
        $ul = bp_document_user_document_folder_tree_view_li_html( bp_loggedin_user_id(), $id );
    }
 
    $first_text = '';
    if ( 'profile' === $type ) {
        $first_text = esc_html__( ' Documents', 'buddyboss' );
    } else {
        if ( bp_is_active( 'groups') ) {
            $group      = groups_get_group( (int) $id );
            $first_text = bp_get_group_name( $group );
        }
    }
 
    wp_send_json_success(
        array(
            'message'         => 'success',
            'html'            => $ul,
            'first_span_text' => stripslashes( $first_text ),
        )
    );
}

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.