/**
  * Constructor.
  *
  * @since 1.9
  */
 public function __construct()
 {
     if (!bp_docs_enable_folders()) {
         return;
     }
     $this->register_post_type();
     $this->register_taxonomies();
     // It is my hope and dream that this will one day be persistent.
     wp_cache_add_non_persistent_groups(array('bp_docs_folders'));
     add_action('bp_docs_enqueue_scripts', array($this, 'enqueue_assets'));
     $this->setup_hooks();
 }
/**
 * Add user information to individual Doc breadcrumbs.
 *
 * Hooked very late to ensure it's the first item on the list.
 *
 * @since 1.9.0
 *
 * @param array $crumbs
 * @return array
 */
function bp_docs_user_single_breadcrumb($crumbs, $doc = null)
{
    if (is_a($doc, 'WP_Post')) {
        $doc_id = $doc->ID;
    } else {
        if (bp_docs_is_existing_doc()) {
            $doc_id = get_queried_object_id();
        }
    }
    if (bp_docs_enable_folders() && !empty($doc_id)) {
        $folder_id = bp_docs_get_doc_folder($doc_id);
        if ($folder_id) {
            $user_id = bp_docs_get_folder_user($folder_id);
        }
    }
    if (!empty($user_id)) {
        $user_crumbs = array(sprintf('<a href="%s">%s&#8217;s Docs</a>', bp_core_get_user_domain($user_id) . bp_docs_get_slug() . '/', bp_core_get_user_displayname($user_id)));
        $crumbs = array_merge($user_crumbs, $crumbs);
    }
    return $crumbs;
}