BP_Notifications_Component::late_includes()
Late includes method.
Description Description
Only load up certain code when on specific pages.
Source Source
File: bp-notifications/classes/class-bp-notifications-component.php
public function late_includes() {
// Bail if PHPUnit is running.
if ( defined( 'BP_TESTS_DIR' ) ) {
return;
}
// Bail if not on a notifications page or logged in.
if ( ! bp_is_user_notifications() || ! is_user_logged_in() ) {
return;
}
// Actions.
if ( bp_is_post_request() ) {
require $this->path . 'bp-notifications/actions/bulk-manage.php';
} elseif ( bp_is_get_request() ) {
require $this->path . 'bp-notifications/actions/delete.php';
}
// Screens.
require $this->path . 'bp-notifications/screens/unread.php';
if ( bp_is_current_action( 'read' ) ) {
require $this->path . 'bp-notifications/screens/read.php';
}
}
Changelog Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |