Created
March 3, 2026 16:36
-
-
Save greenhornet79/11242736ada680f209d00c0ab00afd57 to your computer and use it in GitHub Desktop.
Leaky Paywall user role adjust
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'leaky_paywall_userdata_before_user_create', function( $user_data ) { | |
| // Check if a level_id is available in the registration data. | |
| // Adjust the level ID and role to match your setup. | |
| if ( isset( $_POST['level_id'] ) && '0' === $_POST['level_id'] ) { | |
| $user_data['role'] = 'free_subscriber'; | |
| } | |
| return $user_data; | |
| } ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment