- Timestamp:
- 04/02/2018 04:32:31 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/classes/class-bp-xprofile-component.php
r11360 r11928 68 68 'cssjs', 69 69 'cache', 70 'actions',71 70 'activity', 72 'screens',73 71 'caps', 74 72 'filters', … … 84 82 85 83 parent::includes( $includes ); 84 } 85 86 /** 87 * Late includes method. 88 * 89 * Only load up certain code when on specific pages. 90 * 91 * @since 3.0.0 92 */ 93 public function late_includes() { 94 // Bail if PHPUnit is running. 95 if ( defined( 'BP_TESTS_DIR' ) ) { 96 return; 97 } 98 99 // Bail if not on a user page. 100 if ( ! bp_is_user() ) { 101 return; 102 } 103 104 // User nav. 105 if ( bp_is_profile_component() ) { 106 require $this->path . 'bp-xprofile/screens/public.php'; 107 108 // Action - Delete avatar. 109 if ( is_user_logged_in()&& bp_is_user_change_avatar() && bp_is_action_variable( 'delete-avatar', 0 ) ) { 110 require $this->path . 'bp-xprofile/actions/delete-avatar.php'; 111 } 112 113 // Sub-nav items. 114 if ( is_user_logged_in() && 115 in_array( bp_current_action(), array( 'edit', 'change-avatar', 'change-cover-image' ), true ) 116 ) { 117 require $this->path . 'bp-xprofile/screens/' . bp_current_action() . '.php'; 118 } 119 } 120 121 // Settings. 122 if ( is_user_logged_in() && bp_is_user_settings_profile() ) { 123 require $this->path . 'bp-xprofile/screens/settings-profile.php'; 124 } 86 125 } 87 126
Note: See TracChangeset
for help on using the changeset viewer.