- Timestamp:
- 04/02/2018 02:58:28 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-settings/classes/class-bp-settings-component.php
r10555 r11926 43 43 public function includes( $includes = array() ) { 44 44 parent::includes( array( 45 'actions',46 'screens',47 45 'template', 48 46 'functions', 49 47 ) ); 48 } 49 50 /** 51 * Late includes method. 52 * 53 * Only load up certain code when on specific pages. 54 * 55 * @since 3.0.0 56 */ 57 public function late_includes() { 58 // Bail if PHPUnit is running. 59 if ( defined( 'BP_TESTS_DIR' ) ) { 60 return; 61 } 62 63 // Bail if not on Settings component. 64 if ( ! bp_is_settings_component() ) { 65 return; 66 } 67 68 $actions = array( 'notifications', 'capabilities', 'delete-account' ); 69 70 // Authenticated actions. 71 if ( is_user_logged_in() ) { 72 if ( bp_is_current_action( 'general' ) ) { 73 require $this->path . 'bp-settings/screens/general.php'; 74 75 // Specific to post requests. 76 } elseif ( bp_is_post_request() && in_array( bp_current_action(), $actions, true ) ) { 77 require $this->path . 'bp-settings/actions/' . bp_current_action() . '.php'; 78 } 79 } 80 81 // Screens - User profile integration. 82 if ( bp_is_user() ) { 83 require $this->path . 'bp-settings/screens/general.php'; 84 85 // Sub-nav items. 86 if ( in_array( bp_current_action(), $actions, true ) ) { 87 require $this->path . 'bp-settings/screens/' . bp_current_action() . '.php'; 88 } 89 } 50 90 } 51 91
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)