Changeset 11934 for trunk/src/bp-blogs/classes/class-bp-blogs-component.php
- Timestamp:
- 04/02/2018 06:15:37 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/classes/class-bp-blogs-component.php
r11799 r11934 126 126 $includes = array( 127 127 'cache', 128 'actions',129 'screens',130 128 'template', 131 129 'filters', … … 143 141 // Include the files. 144 142 parent::includes( $includes ); 143 } 144 145 /** 146 * Late includes method. 147 * 148 * Only load up certain code when on specific pages. 149 * 150 * @since 3.0.0 151 */ 152 public function late_includes() { 153 // Bail if PHPUnit is running. 154 if ( defined( 'BP_TESTS_DIR' ) ) { 155 return; 156 } 157 158 // Bail if not on a blogs page or not multisite. 159 if ( ! bp_is_blogs_component() || ! is_multisite() ) { 160 return; 161 } 162 163 // Actions. 164 if ( isset( $_GET['random-blog'] ) ) { 165 require $this->path . 'bp-blogs/actions/random.php'; 166 } 167 168 // Screens. 169 if ( bp_is_user() ) { 170 require $this->path . 'bp-blogs/screens/my-blogs.php'; 171 } else { 172 if ( bp_is_blogs_directory() ) { 173 require $this->path . 'bp-blogs/screens/directory.php'; 174 } 175 176 if ( is_user_logged_in() && bp_is_current_action( 'create' ) ) { 177 require $this->path . 'bp-blogs/screens/create.php'; 178 } 179 180 // Theme compatibility. 181 new BP_Blogs_Theme_Compat(); 182 } 145 183 } 146 184
Note: See TracChangeset
for help on using the changeset viewer.