0

I'm using a Gravity Forms user registration to handle registration processes, and I use Gravity Forms custom post type + wp resume manager to let the user submit some fields in his resume within the registration process. The user registers, fills some fields, and these fields he put are mapped to his resume fields. The resume is just a post.


Here's my problem:

Now the user is registered and has posted his resume and filled some of the fields, I want to redirect him on the first login to the resume edit page to fill the rest of fields.

Here's a sample link:

http://mydomainname/complete-your-resume/?action=edit&resume_id=7038

The resume is a custom post type; the name of the post type is resume and "7038" is the resume post_id.

I already know how to redirect users in first login, but what I don't know is how to do the following:

  1. How to redirect them to "their" resume-post edit page (the above link).
  2. Redirect them based in their role. I want to redirect only users who have role "candidates".
  3. If there a way to prevent them to navigate anywhere until they fill all the fields and save the post/resume.

I will highly appreciate any help of these points above. Thanks in advance.

0

1) GF will save the Form entry ID in the wp_usermeta table for the registered user, so you can grab all the entry(submitted) data and I believe the resume ID too

$entry = get_user_meta( get_current_user_id(), 'entry_id', true );

Then you can get the entry data using the "get_entry" method from the PHP API wrapper class as described in the docs: https://www.gravityhelp.com/documentation/article/web-api/#php-wrapper

See: https://github.com/rocketgenius/webapiclient/blob/master/includes/class-gf-web-api-wrapper.php#L230

Or: https://www.gravityhelp.com/documentation/article/api-functions/#get_entry

Also, you can hook to the GF post created or user activated actions and store the POST ID for that user in the wp_usermeta table, not sure but I believe the post created addon may have a hook for that.

2) See: https://wordpress.stackexchange.com/a/5048/60079

3) You can add a hidden field to the form, save it as user meta and update the value if they complete the resume using the "gform_post_submission" GF hook. I don't like the idea of forcing users to complete the resume, instead, I'll go for a site wide notification. Anyway, you can hook the wp init and always redirect the user to the desired page and hide the navigation on that one too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.