Users can post in the name of a company
Author | Posts |
---|---|
April 24, 2013 at 2:56 pm 2837 | |
noomia | Hi Tareq !
I've been thinking a lot about my project today. I need to do something very specific.
So people can register as "Worker". No problem with that, I have created my custom "Worker" role, created the edit profile page etc...
Than, I have 5 custom post types :
|
April 25, 2013 at 8:58 am 2856 | |
noomia | I definitely need this 🙂 ! It’s the best the user experience 😉 ! So maybe I have to add custom field ‘company_id’ for jobs/news/projects/events’ custom post type ? But then how do I attach it to the project (for example) when I hit the “create a project” link ? |
April 26, 2013 at 6:57 am 2892 | |
noomia | Hi Tareq ! Could you help me achieving that ? I assume I have to create a field in my project form (for example) to handle the company’s ID. But how could I pass the company’s ID depending on which link I have clicked on ? |
April 26, 2013 at 7:59 am 2895 | |
Tareq Hasan | Hi Noomia, I don’t want to be sound harsh, but I think it goes beyond the level of plugin support. May be you should figure out yourself about your project. |
April 26, 2013 at 8:05 am 2896 | |
noomia | Ok. I understand. So I just need to know if it’s possible to pass argument (like post id) to the new form created with WPUF ? So by this way, a field in the form is filled depending on that args. Thanks |
April 26, 2013 at 8:26 am 2897 | |
Tareq Hasan | there are some actions available in the top and bottom of the form. So you can insert hidden fields there based on form id and form settings and handle them with `wpuf_add_post_after_insert` action. Thats what you can do right now. |
April 26, 2013 at 8:39 am 2898 | |
noomia | I mean that I have for example a link to “create a project” form, but in 3 different places. In that form, I need to have an hidden field which handle the id (for example) of the link I clicked on, so I know where do the user come from. So I have to pass some args when the link is clicked… But how ? |
April 26, 2013 at 9:34 am 2902 | |
Tareq Hasan | As I see your schema, you can append a parameter on URL, may be the company ID. Then based on that parameter and with the help of the action hook, you can put a hidden field on the form. Then based on the form type (news/project/event), you can set the post parent as the company post type. |
April 26, 2013 at 9:52 am 2903 | |
noomia | Ok I think I got it, thanks 🙂 But when you say that
What do you mean ?
|
April 26, 2013 at 9:57 am 2904 | |
Tareq Hasan | If I would do it, I would set the event/news/project ‘s `post_parent` to the related company ID, instead of saving the company ID in a custom field. But doesn’t matter, you can solve a problem in many ways. |
April 26, 2013 at 10:01 am 2905 | |
noomia | Nice, you’r right 🙂 ! With the dashboard page, is it possible to display posts that are child of the company, instead of all the post by the user ?
|
April 26, 2013 at 10:05 am 2906 | |
Tareq Hasan | If your version has `wpuf_dashboard_query` filter in dashboard, you could filter the query. If the filter isn’t there, then dashboard query filter needs to be added/adjusted. |
May 28, 2013 at 7:11 am 4265 | |
noomia | Hi Tarek ! I’ve worked a lot here in our project and we face a little problem. Thanks |
May 28, 2013 at 8:20 am 4267 | |
noomia | Maybe it’s easier to have the field in the admin if it’s a custom field. So I have tried to store the company ID in a custom field with the help of an action hook. The field is displayed only in front-end, not in the admin side because the custom field is generated by the action hook… Could you help ? |
May 28, 2013 at 12:30 pm 4274 | |
Tareq Hasan | There is no way you can change the post_parent in the admin area unless you build your custom solution. May be add a new meta box and handle it? |
May 28, 2013 at 12:34 pm 4275 | |
noomia | Hi Tarek ! I choose to do it with custom field. It’s a hidden one so I create it with action hook in WPUF. So in Front-end, I have my hidden field in the source page. But I don’t have it in the wp-admin in the WPUF form meta box. How can I have it there ? |