Changeset 4236 for trunk/bbp-includes/bbp-core-caps.php
- Timestamp:
- 10/09/2012 06:52:38 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/bbp-includes/bbp-core-caps.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bbp-includes/bbp-core-caps.php
r4222 r4236 875 875 return false; 876 876 877 // Bail if not a member of this blog878 if ( ! user_can( $user_id, 'read') )877 // Bail if current user cannot edit this user 878 if ( ! current_user_can( 'edit_user', $user_id ) ) 879 879 return false; 880 880 … … 914 914 return false; 915 915 916 // Bail if not a member of this blog917 if ( ! user_can( $user_id, 'read') )916 // Bail if current user cannot edit this user 917 if ( ! current_user_can( 'edit_user', $user_id ) ) 918 918 return false; 919 919 … … 938 938 // Success 939 939 return true; 940 } 941 942 /** 943 * Helper function hooked to 'bbp_edit_user_profile_update' action to save or update 944 * user roles and capabilities. 945 * 946 * @since bbPress (r4235) 947 * 948 * @param int $user_id 949 * @uses bbp_reset_user_caps() to reset caps 950 * @usse bbp_save_user_caps() to save caps 951 */ 952 function bbp_edit_user_profile_update_capabilities( $user_id = 0 ) { 953 954 // Bail if no user ID was passed 955 if ( empty( $user_id ) ) 956 return; 957 958 // Either reset caps for role 959 if ( ! empty( $_POST['bbp-default-caps'] ) ) { 960 bbp_reset_user_caps( $user_id ); 961 962 // Or set caps individually 963 } else { 964 bbp_save_user_caps( $user_id ); 965 } 940 966 } 941 967
Note: See TracChangeset
for help on using the changeset viewer.