• Resolved sevans917

    (@sevans917)


    For the option in toolbox to Redirect users to a page if they have empty required fields, is it filterable? I want the redirect to fire for a particular role only.

Viewing 1 replies (of 1 total)
  • Plugin Author Georgian Cocora

    (@raster02)

    Hello @sevans917,

    Thank you for the suggestion. I’ve added a filter that can be used to achieve this.

    First, you will need to update the current version of the Toolbox add-on, so please go to the add-on page download and replace your current version.

    Then this filter will become available:

    add_filter( 'wppb_toolbox_redirect_if_empty_required', 'wppbc_redirect_only_certain_roles', 20, 2 );
    function wppbc_redirect_only_certain_roles( $redirect, $user_id ){
    	if( empty( $user_id ) )
    		return $redirect;
    
    	//check user role
    
    	//do not redirect
    	return false;
    }

    The $user_id is available as a parameter. You need to do the required check and then in order to not redirect, return false.

    Let me know if this worked or if you have questions.

    Regards.

Viewing 1 replies (of 1 total)

The topic ‘Redirect users if empty required fields–by role?’ is closed to new replies.