bp_nouveau_ajax_document_get_folder_view()

Description

Source

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

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.