Notifications
Clear all

wpForo 1.x.x [Solved] How to show personal member fields in member account page

8 Posts
2 Users
1 Reactions
1,299 Views
Posts: 10
Topic starter
(@piero62)
Active Member
Joined: 1 year ago

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

Posts: 10
Topic starter
(@piero62)
Active Member
Joined: 1 year ago

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