Changeset 11220
- Timestamp:
- 11/03/2016 08:33:35 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-caps.php
r11203 r11220 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. … … 72 72 } 73 73 add_filter( 'bp_map_meta_caps', 'bp_xprofile_map_meta_caps', 10, 4 ); 74 75 /** 76 * Grant the 'bp_xprofile_change_field_visibility' cap to logged-out users. 77 * 78 * @since 2.7.1 79 * 80 * @param bool $user_can 81 * @param int $user_id 82 * @param string $capability 83 * @return bool 84 */ 85 function bp_xprofile_grant_bp_xprofile_change_field_visibility_for_logged_out_users( $user_can, $user_id, $capability ) { 86 if ( 'bp_xprofile_change_field_visibility' === $capability && 0 === $user_id ) { 87 $user_can = true; 88 } 89 90 return $user_can; 91 } 92 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.