Jan 22, 2023 4:05 pm
Ok understood but in this way the resctiction will apply in determinate group per single filed about what kinds of fields can see.
So for each group I need to set it.
With the same filter it could be done globally in this way:
add_filter('wpforo_profile_field_displaying_restriction', function(){ $memberGroup = [some code]; if($memberGroup === 'My Group'){ return false; } else{ return true; } });
it is possible ?
Thank you
Piercarlo
Jan 22, 2023 5:24 pm
Ok sorry for confusion I found the way, so I examinated this pieces of code at the end of "profile-home.php" file:
<div class="wpf-profile-section wpf-mi-section"> <div class="wpf-table"> <?php if( apply_filters('wpforo_profile_field_displaying_restriction', true) ): ?> <?php if( WPF()->usergroup->can( 'em', wpfval( WPF()->current_object['user'], 'groupid' ) ) || wpfval( WPF()->current_object['user'], 'posts' ) ): ?> <?php wpforo_fields( $fields ); ?> <?php endif; ?> <?php else: ?> <?php wpforo_fields( $fields ); ?> <?php endif; ?> </div> </div>
As I could read, to show user fields need to have some posts published or the Group need to have 'em' permission that means "User Edit" permission.
So basically for "my custom group" member need to post something to show it, needn't to put the hands on code.
Thank you in any case.
Bye
Piercarlo
Page 2 / 2
Prev