strangerstudios / pmpro-register-helper

A robust plugin to collect additional fields for WordPress users. Fields can be collected at membership checkout, on the user's profile or for administrative view-only.
https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/
29 stars 41 forks source link

Enhancement: more values for the option "profile" #195

Open mircobabini opened 4 years ago

mircobabini commented 4 years ago

Is your feature request related to a problem? Please describe. If I set a field to be shown only of certain membership levels the field is hidden for the other levels on admin's profile edit page as well. This is not wrong, but doesn't mean it's perfect.

Describe the solution you'd like I'd love to see the value a user filled to certain fields even if he changes his membership level.

Describe alternatives you've considered I think we can add some options to the "profile" option.

Or maybe a filter in pmprorh_checkFieldForLevel function, to be used as: add_filter( 'pmprorh_checkfieldforlevel', '__return_true' );

dparker1005 commented 3 years ago

Another approach would be to instead filter this line to show all fields on the profile: https://github.com/strangerstudios/pmpro-register-helper/blob/92895173dc266e690eefa6af978e40748590d13b/pmpro-register-helper.php#L1063

The benefit of this over filling the entire pmprorh_checkFieldForLevel() function would be that this approach would not affect fields being shown/validated at checkout and elsewhere.