BP_Blogs_Component::late_includes()
Late includes method.
Description
Only load up certain code when on specific pages.
Source
File: bp-blogs/classes/class-bp-blogs-component.php
public function late_includes() { // Bail if PHPUnit is running. if ( defined( 'BP_TESTS_DIR' ) ) { return; } // Bail if not on a blogs page or not multisite. if ( ! bp_is_blogs_component() || ! is_multisite() ) { return; } // Actions. if ( isset( $_GET['random-blog'] ) ) { require $this->path . 'bp-blogs/actions/random.php'; } // Screens. if ( bp_is_user() ) { require $this->path . 'bp-blogs/screens/my-blogs.php'; } else { if ( bp_is_blogs_directory() ) { require $this->path . 'bp-blogs/screens/directory.php'; } if ( is_user_logged_in() && bp_is_current_action( 'create' ) ) { require $this->path . 'bp-blogs/screens/create.php'; } // Theme compatibility. new BP_Blogs_Theme_Compat(); } }
Changelog
Version | Description |
---|---|
BuddyPress 3.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.