- Timestamp:
- 04/02/2018 05:35:08 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-notifications/classes/class-bp-notifications-component.php
r11360 r11933 45 45 public function includes( $includes = array() ) { 46 46 $includes = array( 47 'actions',48 'screens',49 47 'adminbar', 50 48 'template', … … 54 52 55 53 parent::includes( $includes ); 54 } 55 56 /** 57 * Late includes method. 58 * 59 * Only load up certain code when on specific pages. 60 * 61 * @since 3.0.0 62 */ 63 public function late_includes() { 64 // Bail if PHPUnit is running. 65 if ( defined( 'BP_TESTS_DIR' ) ) { 66 return; 67 } 68 69 // Bail if not on a notifications page or logged in. 70 if ( ! bp_is_user_notifications() || ! is_user_logged_in() ) { 71 return; 72 } 73 74 // Actions. 75 if ( bp_is_post_request() ) { 76 require $this->path . 'bp-notifications/actions/bulk-manage.php'; 77 } elseif ( bp_is_get_request() ) { 78 require $this->path . 'bp-notifications/actions/delete.php'; 79 } 80 81 // Screens. 82 require $this->path . 'bp-notifications/screens/unread.php'; 83 if ( bp_is_current_action( 'read' ) ) { 84 require $this->path . 'bp-notifications/screens/read.php'; 85 } 56 86 } 57 87
Note: See TracChangeset
for help on using the changeset viewer.