BP_Document_Component::late_includes()

Late includes method.

Description

Only load up certain code when on specific pages.

Source

File: bp-document/classes/class-bp-document-component.php

105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
public function late_includes() {
    // Bail if PHPUnit is running.
    if ( defined( 'BP_TESTS_DIR' ) ) {
        return;
    }
 
    if ( bp_is_document_component() ) {
 
        // Screens - Directory.
        if ( bp_is_document_directory() && ( bp_is_profile_document_support_enabled() || bp_is_group_document_support_enabled() ) ) {
            require $this->path . 'bp-document/screens/directory.php';
        }
 
        // Screens - User profile integration.
        if ( bp_is_user() && bp_is_profile_document_support_enabled() ) {
            require $this->path . 'bp-document/screens/document.php';
 
            /*
             * Nav items.
             *
             * 'folder' is not a registered nav item, but we add a screen handler manually.
             */
            if ( bp_is_user_document() && in_array( bp_current_action(), array( 'folders' ), true ) ) {
                require $this->path . 'bp-document/screens/' . bp_current_action() . '.php';
            }
        }
 
        // Theme compatibility.
        new BP_Document_Theme_Compat();
    }
}

Changelog

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.