좀 프로필 필드를 숨길하는 데 도움이 될 수 있습니다 BuddyPress의 방법이 알고buddypress 숨기기 프로필 필드
function bp_has_profile($args = '') {
global $profile_template;
// Only show empty fields if we're on the Dashboard, or we're on a user's profile edit page,
// or this is a registration page
$hide_empty_fields_default = (!is_network_admin() && !is_admin() && !bp_is_user_profile_edit() && !bp_is_register_page());
// We only need to fetch visibility levels when viewing your own profile
if (bp_is_my_profile() || bp_current_user_can('bp_moderate') || bp_is_register_page()) {
$fetch_visibility_level_default = true;
} else {
$fetch_visibility_level_default = false;
}
$defaults = array(
'user_id' => bp_displayed_user_id(),
'profile_group_id' => false,
'hide_empty_groups' => true,
'hide_empty_fields' => $hide_empty_fields_default,
'fetch_fields' => true,
'fetch_field_data' => true,
'fetch_visibility_level' => $fetch_visibility_level_default,
'exclude_groups' => false, // Comma-separated list of profile field group IDs to exclude
'exclude_fields' => false // Comma-separated list of profile field IDs to exclude
);
$r = wp_parse_args($args, $defaults);
extract($r, EXTR_SKIP);
$profile_template = new BP_XProfile_Data_Template($user_id, $profile_group_id, $hide_empty_groups, $fetch_fields, $fetch_field_data, $exclude_groups, $exclude_fields, $hide_empty_fields, $fetch_visibility_level);
return apply_filters('bp_has_profile', $profile_template->has_groups(), $profile_template);
}
나는이 메서드를 호출하고 'exclude_fields'=> $ IDs_to_hide
을 전달하는 방법을 잘 모르겠습니다