How to reload the role specific registration form on validation errors?

You can either user session or cookies to setup the user for the desired role e.g: /** * register_roles_with_cookies */ class register_roles_with_cookies { function __construct($args = array()){ //create a hidden field for role and extra fields needed add_action(‘register_form’,array($this,’add_hidden_role_field’)); //validate add_action(‘register_post’,array($this,’my_user_fields_validation’),10,3); //save the role add_action(‘user_register’, array($this,’update_role’)); } public function setCookie($name,$val,$time = false){ if(false === $time) $time … Read more

Customize the “Registration complete. Please check your e-mail.” message on WP 4.0

If you need an alternative way, you can always hook into the login_init and modify the gettext filter: add_filter( ‘login_init’, function() { add_filter( ‘gettext’, ‘wpse_161709’, 99, 3 ); } ); function wpse_161709( $translated_text, $untranslated_text, $domain ) { $old = “Registration complete. Please check your e-mail.”; $new = “New text here”; if ( $untranslated_text === $old … Read more

Limit content by user registration date

I have just made this code you can try out: add_filter( ‘the_content’, ‘restrict_access’ ); function restrict_access( $content ) { $user_info = wp_get_current_user(); // Get logged in user info $registered = $user_info->user_registered; if( !is_user_logged_in() ) { $content = __( “You are not logged in.”, ‘your_textdomain’ ); } else if (new DateTime( get_the_date() ) < new DateTime( … Read more