Created
March 16, 2022 17:59
-
-
Save DumahX/e04a5f71667c25f47fb226e5ef33abfc to your computer and use it in GitHub Desktop.
This file contains 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 | |
function add_optin_status($user) { | |
if(isset($_POST['meprconvertkit_opt_in'])) { | |
update_user_meta($user->ID, 'mepr_convertkit_optin_status', true); | |
} else { | |
update_user_meta($user->ID, 'mepr_convertkit_optin_status', false); | |
} | |
} | |
add_action('mepr-signup-user-loaded', 'add_optin_status', 11); | |
function render_optin_status_field($user) { | |
?> | |
<tr> | |
<th> | |
<label>Opt-In Status</label> | |
</th> | |
<td> | |
<?php if(get_user_meta($user->ID, 'mepr_convertkit_optin_status', true)): ?> | |
User has opted in to newsletter. | |
<?php else: ?> | |
User has NOT opted in to newsletter. | |
<?php endif; ?> | |
</td> | |
</tr> | |
<?php | |
} | |
add_action('mepr_extra_profile_fields', 'render_optin_status_field'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment