Changeset 5799
- Timestamp:
- 02/16/2012 10:36:14 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-caps.php
r5797 r5799 7 7 * @since 1.6 8 8 */ 9 10 // Exit if accessed directly 11 if ( ! defined( 'ABSPATH' ) ) exit; 9 12 10 13 /** … … 27 30 case 'bp_xprofile_change_field_visibility' : 28 31 $caps = array( 'read' ); 29 32 30 33 // You may pass args manually: $field_id, $profile_user_id 31 $field_id 34 $field_id = isset( $args[0] ) ? (int)$args[0] : bp_get_the_profile_field_id(); 32 35 $profile_user_id = isset( $args[1] ) ? (int)$args[1] : bp_displayed_user_id(); 33 36 34 37 // Visibility on the fullname field is not editable 35 38 if ( 1 == $field_id ) { … … 37 40 break; 38 41 } 39 42 40 43 // Has the admin disabled visibility modification for this field? 41 44 if ( 'disabled' == bp_xprofile_get_meta( $field_id, 'field', 'allow_custom_visibility' ) ) { … … 53 56 break; 54 57 } 55 58 56 59 return apply_filters( 'bp_xprofile_map_meta_caps', $caps, $cap, $user_id, $args ); 57 60 } 58 61 add_filter( 'bp_map_meta_caps', 'bp_xprofile_map_meta_caps', 10, 4 ); 59 60 62 ?>
Note: See TracChangeset
for help on using the changeset viewer.