Require User Fields on the Member Profile Edit Page

When you add user fields to membership checkout, the checkout process is blocked until all required fields are completed. We handle user fields a bit differently on the frontend user profile screen, where PMPro does not block the form from updating if required fields are missed.

If you must require fields on the frontend profile screen, you need the custom code in this recipe. This code hooks into the form submission using the pmpro_user_profile_update_errors hook to require specific fields before saving. The code also adds to the error message shown on form submission failure.

This content requires a premium membership plan.