admin管理员组文章数量:1415484
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:
- How to redirect them to "their" resume-post edit page (the above link).
- Redirect them based in their role. I want to redirect only users who have role "candidates".
- 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.
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:
- How to redirect them to "their" resume-post edit page (the above link).
- Redirect them based in their role. I want to redirect only users who have role "candidates".
- 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.
Share Improve this question edited May 25, 2017 at 5:39 Morgan Estes 1,55512 silver badges22 bronze badges asked May 25, 2017 at 1:11 moemoe 11 Answer
Reset to default 01) 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/documentation/article/web-api/#php-wrapper
See: https://github/rocketgenius/webapiclient/blob/master/includes/class-gf-web-api-wrapper.php#L230
Or: https://www.gravityhelp/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/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.
本文标签: custom post typesRedirect users in first login to a dynamic link
版权声明:本文标题:custom post types - Redirect users in first login to a dynamic link 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745231851a2648858.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论