- Timestamp:
- 04/01/2018 11:30:48 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/classes/class-bp-groups-component.php
r11783 r11923 124 124 $includes = array( 125 125 'cache', 126 'actions',127 126 'filters', 128 'screens',129 127 'widgets', 130 128 'activity', … … 140 138 141 139 parent::includes( $includes ); 140 } 141 142 /** 143 * Late includes method. 144 * 145 * Only load up certain code when on specific pages. 146 * 147 * @since 3.0.0 148 */ 149 public function late_includes() { 150 // Bail if PHPUnit is running. 151 if ( defined( 'BP_TESTS_DIR' ) ) { 152 return; 153 } 154 155 if ( bp_is_groups_component() ) { 156 // Authenticated actions. 157 if ( is_user_logged_in() && 158 in_array( bp_current_action(), array( 'create', 'join', 'leave-group' ), true ) 159 ) { 160 require $this->path . 'bp-groups/actions/' . bp_current_action() . '.php'; 161 } 162 163 // Actions - RSS feed handler. 164 if ( bp_is_active( 'activity' ) && bp_is_current_action( 'feed' ) ) { 165 require $this->path . 'bp-groups/actions/feed.php'; 166 } 167 168 // Actions - Random group handler. 169 if ( isset( $_GET['random-group'] ) ) { 170 require $this->path . 'bp-groups/actions/random.php'; 171 } 172 173 // Screens - Directory. 174 if ( bp_is_groups_directory() ) { 175 require $this->path . 'bp-groups/screens/directory.php'; 176 } 177 178 // Screens - User profile integration. 179 if ( bp_is_user() ) { 180 require $this->path . 'bp-groups/screens/user/my-groups.php'; 181 182 if ( bp_is_current_action( 'invites' ) ) { 183 require $this->path . 'bp-groups/screens/user/invites.php'; 184 } 185 } 186 187 // Single group. 188 if ( bp_is_group() ) { 189 // Actions - Access protection. 190 require $this->path . 'bp-groups/actions/access.php'; 191 192 // Public nav items. 193 if ( in_array( bp_current_action(), array( 'home', 'request-membership', 'activity', 'members', 'send-invites' ), true ) ) { 194 require $this->path . 'bp-groups/screens/single/' . bp_current_action() . '.php'; 195 } 196 197 // Admin nav items. 198 if ( bp_is_item_admin() && is_user_logged_in() ) { 199 require $this->path . 'bp-groups/screens/single/admin.php'; 200 201 if ( in_array( bp_get_group_current_admin_tab(), array( 'edit-details', 'group-settings', 'group-avatar', 'group-cover-image', 'manage-members', 'membership-requests', 'delete-group' ), true ) ) { 202 require $this->path . 'bp-groups/screens/single/admin/' . bp_get_group_current_admin_tab() . '.php'; 203 } 204 } 205 } 206 207 // Theme compatibility. 208 new BP_Groups_Theme_Compat(); 209 } 210 211 // Groups notifications HTML table. 212 if ( bp_is_user_settings_notifications() ) { 213 require $this->path . 'bp-groups/screens/user/settings-email.php'; 214 } 142 215 } 143 216
Note: See TracChangeset
for help on using the changeset viewer.