Changeset 13976
- Timestamp:
- 07/25/2024 02:04:23 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/classes/class-bp-members-admin.php
r13975 r13976 977 977 } 978 978 979 if ( $user_id === $this->current_user_id && ! $this->is_self_profile ) { 980 $this->is_self_profile = true; 981 } 982 979 983 // Build redirection URL. 980 984 $redirect_to = remove_query_arg( array( 'action', 'error', 'updated', 'spam', 'ham', 'delete_avatar' ), $_SERVER['REQUEST_URI'] ); … … 1012 1016 add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) ); 1013 1017 1014 get_current_screen()->add_help_tab( array( 1018 $show_avatars = buddypress()->avatar->show_avatars; 1019 $member_types = bp_get_member_types(); 1020 $help_content = array( 1021 'overview' => __( 'This is the admin view of a user’s extended profile.', 'buddypress' ), 1022 'main_column' => __( 'In the main column, you can edit the fields of the user’s extended profile.', 'buddypress' ), 1023 'right_column' => __( 'In the right-hand column, you can:', 'buddypress' ), 1024 ); 1025 1026 $available_actions = array( 1027 'status' => __( 'update the user’s status', 'buddypress' ), 1028 'avatar' => __( 'delete the user’s profile photo', 'buddypress' ), 1029 'types' => __( 'assign a user to one or more member types', 'buddypress' ), 1030 'stats' => __( 'view recent statistics', 'buddypress' ), 1031 ); 1032 1033 if ( ! bp_is_active( 'xprofile' ) ) { 1034 $help_content['main_column'] = __( 'In the main column, you can view recent statistics about the user.', 'buddypress' ); 1035 unset( $available_actions['stats'] ); 1036 } 1037 1038 if ( ! $show_avatars ) { 1039 unset( $available_actions['avatar'] ); 1040 } 1041 1042 if ( ! $member_types ) { 1043 unset( $available_actions['types'] ); 1044 } 1045 1046 if ( true === $this->is_self_profile ) { 1047 $help_content['overview'] = __( 'This is the admin view of your extended profile.', 'buddypress' ); 1048 1049 if ( isset( $available_actions['stats'] ) ) { 1050 $help_content['main_column'] = __( 'In the main column, you can edit the fields of your extended profile.', 'buddypress' ); 1051 $available_actions['stats'] = __( 'view your recent statistics', 'buddypress' ); 1052 } else { 1053 $help_content['main_column'] = __( 'In the main column, you can view your recent statistics.', 'buddypress' ); 1054 } 1055 1056 unset( $available_actions['status'] ); 1057 1058 if ( isset( $available_actions['types'] ) ) { 1059 $available_actions['types'] = __( 'view the member types you’re assigned to', 'buddypress' ); 1060 } 1061 1062 if ( isset( $available_actions['avatar'] ) ) { 1063 $available_actions['avatar'] = __( 'edit or delete your profile photo', 'buddypress' ); 1064 } 1065 1066 } elseif ( is_multisite() && ! current_user_can( 'manage_network_users' ) ) { 1067 unset( $available_actions['status'] ); 1068 } 1069 1070 if ( ! $available_actions ) { 1071 unset( $help_content['right_column'] ); 1072 } 1073 1074 $help_tab_args = array( 1015 1075 'id' => 'bp-profile-edit-overview', 1016 1076 'title' => __( 'Overview', 'buddypress' ), 1017 'content' => 1018 '<p>' . __( 'This is the admin view of a user's profile.', 'buddypress' ) . '</p>' . 1019 '<p>' . __( 'In the main column, you can edit the fields of the user's extended profile.', 'buddypress' ) . '</p>' . 1020 '<p>' . __( 'In the right-hand column, you can update the user's status, delete the user's avatar, and view recent statistics.', 'buddypress' ) . '</p>' 1021 ) ); 1077 'content' => '<p>' . implode( ' ', $help_content ) . '</p>', 1078 ); 1079 1080 if ( isset( $help_content['right_column'] ) ) { 1081 $help_tab_args['content'] .= '<ul><li>' . implode( '</li><li>', $available_actions ) . '</li></ul>'; 1082 } 1083 1084 get_current_screen()->add_help_tab( $help_tab_args ); 1022 1085 1023 1086 // Help panel - sidebar links. 1024 1087 get_current_screen()->set_help_sidebar( 1025 1088 '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . 1026 '<p>' . __( '<a href="https:// codex.buddypress.org/administrator-guide/extended-profiles/">Managing Profiles</a>', 'buddypress' ) . '</p>' .1089 '<p>' . __( '<a href="https://github.com/buddypress/buddypress/blob/master/docs/user/administration/users/profile.md">Using Extended Profile</a>', 'buddypress' ) . '</p>' . 1027 1090 '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' 1028 1091 ); … … 1079 1142 ); 1080 1143 1081 if ( buddypress()->avatar->show_avatars ) {1144 if ( $show_avatars ) { 1082 1145 // Avatar Metabox. 1083 1146 add_meta_box( … … 1092 1155 1093 1156 // Member Type metabox. Only added if member types have been registered. 1094 $member_types = bp_get_member_types();1095 1157 if ( ! empty( $member_types ) ) { 1096 1158 add_meta_box(
Note: See TracChangeset
for help on using the changeset viewer.