Changeset 11221
- Timestamp:
- 11/03/2016 08:35:23 AM (10 years ago)
- File:
-
- 1 edited
-
branches/2.7/src/bp-xprofile/bp-xprofile-caps.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.7/src/bp-xprofile/bp-xprofile-caps.php
r11052 r11221 26 26 switch ( $cap ) { 27 27 case 'bp_xprofile_change_field_visibility' : 28 $caps = array( 'exist' ); // Must allow for logged-out users during registration.28 $caps = array( 'exist' ); 29 29 30 30 // You may pass args manually: $field_id, $profile_user_id. … … 66 66 } 67 67 add_filter( 'bp_map_meta_caps', 'bp_xprofile_map_meta_caps', 10, 4 ); 68 69 /** 70 * Grant the 'bp_xprofile_change_field_visibility' cap to logged-out users. 71 * 72 * @since 2.7.1 73 * 74 * @param bool $user_can 75 * @param int $user_id 76 * @param string $capability 77 * @return bool 78 */ 79 function bp_xprofile_grant_bp_xprofile_change_field_visibility_for_logged_out_users( $user_can, $user_id, $capability ) { 80 if ( 'bp_xprofile_change_field_visibility' === $capability && 0 === $user_id ) { 81 $user_can = true; 82 } 83 84 return $user_can; 85 } 86 add_filter( 'bp_user_can', 'bp_xprofile_grant_bp_xprofile_change_field_visibility_for_logged_out_users', 10, 3 );
Note: See TracChangeset
for help on using the changeset viewer.