Skip to content

Commit 55c17df

Browse files
authored
fix - Field Visibility add-on does not hide selected fields on My Account / Profile Details page (UR-4643) (#1338)
* fix - apply field visibility filter to profile details read-only view (UR-4643) The My Account > Profile Details read-only view rendered the raw form data without applying the `user_registration_profile_account_filter_all_fields` filter, so fields configured to be hidden on Profile Details (e.g. via the Field Visibility add-on set to "Registration Form") still appeared for regular users. The editable profile form already applies this filter through user_registration_form_data(); this makes the read-only view consistent. * fix - condense inline comment on profile details visibility filter (UR-4643)
1 parent c3f1950 commit 55c17df

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

templates/myaccount/form-edit-profile.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,9 @@
345345
$form_id = ur_get_form_id_by_userid( $user_id );
346346
$form_data_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();
347347

348+
// Apply field visibility filter to the read-only view too, so fields hidden on Profile Details are not rendered here.
349+
$form_data_array = apply_filters( 'user_registration_profile_account_filter_all_fields', $form_data_array, $form_id, current_user_can( 'manage_options' ) );
350+
348351
$row_ids = array();
349352
if ( ! empty( $form_data_array ) ) {
350353
$row_ids = get_post_meta( $form_id, 'user_registration_form_row_ids', true );

0 commit comments

Comments
 (0)