BP_Media_Component::late_includes()

Late includes method.

Description

Only load up certain code when on specific pages.

Source

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

112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
public function late_includes() {
    // Bail if PHPUnit is running.
    if ( defined( 'BP_TESTS_DIR' ) ) {
        return;
    }
 
    if ( bp_is_media_component() ) {
 
        // Screens - Directory.
        if ( bp_is_media_directory() ) {
            require $this->path . 'bp-media/screens/directory.php';
        }
 
        // Screens - User profile integration.
        if ( bp_is_user() ) {
            require $this->path . 'bp-media/screens/media.php';
 
            /*
             * Nav items.
             *
             * 'album' is not a registered nav item, but we add a screen handler manually.
             */
            if ( bp_is_user_media() && in_array( bp_current_action(), array( 'albums' ), true ) ) {
                require $this->path . 'bp-media/screens/' . bp_current_action() . '.php';
            }
        }
 
        // Theme compatibility.
        new BP_Media_Theme_Compat();
    }
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.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.