- Timestamp:
- 02/29/2020 04:09:19 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/classes/class-bp-xprofile-component.php
r12488 r12559 113 113 require $this->path . 'bp-xprofile/screens/public.php'; 114 114 115 // Action - Delete avatar.116 if ( is_user_logged_in()&& bp_is_user_change_avatar() && bp_is_action_variable( 'delete-avatar', 0 ) ) {117 require $this->path . 'bp-xprofile/actions/delete-avatar.php';118 }119 120 115 // Sub-nav items. 121 if ( is_user_logged_in() && 122 in_array( bp_current_action(), array( 'edit', 'change-avatar', 'change-cover-image' ), true ) 123 ) { 124 require $this->path . 'bp-xprofile/screens/' . bp_current_action() . '.php'; 116 if ( is_user_logged_in() && 'edit' === bp_current_action() ) { 117 require $this->path . 'bp-xprofile/screens/edit.php'; 125 118 } 126 119 } … … 279 272 ); 280 273 281 // Change Avatar.282 if ( buddypress()->avatar->show_avatars ) {283 $sub_nav[] = array(284 'name' => _x( 'Change Profile Photo', 'Profile header sub menu', 'buddypress' ),285 'slug' => 'change-avatar',286 'parent_url' => $profile_link,287 'parent_slug' => $slug,288 'screen_function' => 'xprofile_screen_change_avatar',289 'position' => 30,290 'user_has_access' => $access291 );292 }293 294 // Change Cover image.295 if ( bp_displayed_user_use_cover_image_header() ) {296 $sub_nav[] = array(297 'name' => _x( 'Change Cover Image', 'Profile header sub menu', 'buddypress' ),298 'slug' => 'change-cover-image',299 'parent_url' => $profile_link,300 'parent_slug' => $slug,301 'screen_function' => 'xprofile_screen_change_cover_image',302 'position' => 40,303 'user_has_access' => $access304 );305 }306 307 274 // The Settings > Profile nav item can only be set up after 308 275 // the Settings component has run its own nav routine. … … 388 355 'position' => 20 389 356 ); 390 391 // Edit Avatar.392 if ( buddypress()->avatar->show_avatars ) {393 $wp_admin_nav[] = array(394 'parent' => 'my-account-' . $this->id,395 'id' => 'my-account-' . $this->id . '-change-avatar',396 'title' => _x( 'Change Profile Photo', 'My Account Profile sub nav', 'buddypress' ),397 'href' => trailingslashit( $profile_link . 'change-avatar' ),398 'position' => 30399 );400 }401 402 if ( bp_displayed_user_use_cover_image_header() ) {403 $wp_admin_nav[] = array(404 'parent' => 'my-account-' . $this->id,405 'id' => 'my-account-' . $this->id . '-change-cover-image',406 'title' => _x( 'Change Cover Image', 'My Account Profile sub nav', 'buddypress' ),407 'href' => trailingslashit( $profile_link . 'change-cover-image' ),408 'position' => 40409 );410 }411 357 } 412 358 … … 504 450 'BP_REST_XProfile_Field_Groups_Endpoint', 505 451 'BP_REST_XProfile_Data_Endpoint', 506 'BP_REST_Attachments_Member_Avatar_Endpoint',507 452 ) ); 508 453 }
Note: See TracChangeset
for help on using the changeset viewer.