Skip Navigation

[Resolved] User Permission to View and Edit Custom Posts

This support ticket is created 4 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 6 replies, has 2 voices.

Last updated by AlimB3245 4 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#1638211

Tell us what you are trying to do? I've created a custom role and a custom post and allowed the ROLE permission to READ and EDIT OWN in the CUSTOM POST permissions tab in ACCESS CONTROL.. I logged in as the user with that role.. I was able to view the Dashboard, View My Profile and VIEW all custom posts.. I would like to know if I can disable Dashboard and My Profile Acceess and only allow the menu for the custom post... In the Menu I would like the user to only be able to VIEW and EDIT the POST assigned to him and nothing else..

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site? hidden link

#1638761

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2020-05-26 at 10.47.16 AM.png
Screenshot 2020-05-26 at 10.40.41 AM.png

Hi Alim,

Assuming that you don't want the users to have access to the backend at all and only create / edit their own posts on the frontend only correct?

This is going to require 2 things, A view and A form to create and edit your post. This will allow the user to edit/create their post on the frontend.

Step 1:

First thing you need to do is to create your view block by going to Pages and create your page that you will be using to allow the user to view their own posts.

Next you will need to setup the view block to list out the post type that you want the user to have. On the right hand corner you will see a tab called Block, at the bottom of this tab you will see a section called Query Filter. Add a new query filter for the Post Author and set it to the current logged in user. See Screenshot.

Once you've done this it will allow your users to see their own posts on the frontend.

Step 2:

You will need a Form to allow the user to edit their posts.

1. Go to Toolset -> Forms and create an edit form for the Post type.
2. Once you have created the edit form and save it, go to Toolset -> Content templates and create a content template to hold the edit form.
3. Insert your edit form into the content template by using the Forms block.
4. Go back to your page where you've created your view and inside the view add a Field and Text Block.
5. Using the Toolset forms button on the Field and Text block insert an edit Post Link . See Screenshot
6. Finally Select your Content template and then select "Insert Shortcode".

Once you've followed all these steps you should have a view on the frontend with an edit link under each of the posts. The user can click this link to be taken to their post's edit form to make changes to their post.

Please let me know if this helps.
Thanks,
Shane

#1639245

Hi Shane

Thanks for this info.. I didn't realise that we had this option of allowing frontend edit of posts.. but yes, if this option exists I would prefer this option.

I always thought one had to go to the backend and I'd have to reduce the permissions of the user so that he can't access the other menus.. but the frontend option is perfect..:-).. solves all my problems.

Let me try out your suggestions and I will get back to you later today on this.

Thanks again.. have a nice day..:-)..

Regards,
Alim

#1639323

Hi Shane

Worked perfectly..:-).. and I prefer this option (front-end).. I didn't know about this option.. but I am glad I found out.. do does that mean that I can have a user login too without directing him to my /wp-admin section?

I'd like to have the user login without sending him to the /wp-admin if that's possible.

And if not, is there an option to redirect all users of a custom role to a certain landing page?

Please do advise.. I do understand that this might be digressing from the topic.. so do feel free to split the topic to a new thread if you need.

Regards,
Alim

#1640065

Hi Shane

A small issue that I had with this one step

2. Once you have created the edit form and save it, go to Toolset -> Content templates and create a content template to hold the edit form.

Now I realise that I had created this content template and called it 'My Optical Store' and assigned it to the custom post. I already had an existing Content Template for the Custom Post.

Now I realise that the existing custom post is no longer existing and has been overwritten by the content template I had created for the form... Does that mean a custom post can have only one content template? and If yes, then how do I do step #2 (create a content template for the form) without messing up my exisiting template (for the view)

Regards,
Alim

#1640115

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Alim,

I'd like to have the user login without sending him to the /wp-admin if that's possible.

Are you currently using the default login page for wordpress ? Meaning you log in by going to /wp-admin and enter your login details ?

If you are then you can work around this by setting up a dedicated login page and use the shortcode below.
https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-login-form

It also offers redirection options for you to redirect your users after they log in.

For your next issue, you will need to create a Separate content template that will hold this edit form alone. You will Not assign this content template to any Post Type, its just meant to hold the form alone.

What happens is that when you click the edit link on the frontend is that It will replace the data on the frontend with the content template that contains the form, which will allow the users to edit the posts on the Frontend.

So if you've assigned it to a Post Type please unassign it from the Post Type and re-assign your original Content template back to your Posts.

Also you can only have 1 content template assigned to a post.

Please let me know if this clears thing sup for you.

Thanks,
Shane

#1640915

My issue is resolved now. Thank you!

Thanks Shane..:-)..

Regards,
Alim