bp_document_get_folder_children( $folder_id )
Return all the children folder of the given folder.
Description
Parameters
- $folder_id
-
(Required)
Return
(array)
Source
File: bp-document/bp-document-functions.php
function bp_document_get_folder_children( $folder_id ) { global $bp, $wpdb; $table = $bp->document->table_name_folder; $query = $wpdb->prepare( "SELECT id FROM `{$table}` WHERE FIND_IN_SET(`id`, ( SELECT GROUP_CONCAT(Level SEPARATOR ',') FROM ( SELECT @Ids := ( SELECT GROUP_CONCAT(`id` SEPARATOR ',') FROM `{$table}` WHERE FIND_IN_SET(`parent`, @Ids) ) Level FROM `{$table}` JOIN (SELECT @Ids := %d) temp1 ) temp2 ))", $folder_id ); return array_map( 'intval', $wpdb->get_col( $query ) ); }
Changelog
Version | Description |
---|---|
BuddyBoss 1.4.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.