Skip Navigation

[Resolved] Please add this reply to previous thread

This support ticket is created 3 years, 11 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+00:00)

Author
Posts
#1626131

Hi! I just want to post a final reply to this thread:
https://toolset.com/forums/topic/how-to-add-read_private_posts-to-custom-post-type/

but it's been closed. Please add this reply somehow, and then delete this issue. Thank you!

---

Thank you for this thorough reply! I really appreciate it, and I apologize for not responding sooner.

I figured out what my problem was. When creating the custom permission, such as

read_private_donates

, I assumed that I needed to form it based on the post type Slug, such as

donate

. I must have read somewhere that you were supposed to add "s" to the slug (which seemed brittle).

It turns out that instead, you have to use the post type's Name plural.

For example, what was NOT working for me was a post type like this:

Name plural: Donation Forms
Name singular: Donate
Slug: donate
custom permission: read_private_donates

The solution was to change Name plural to exactly what I would use in the permission:

donates

.

So, this DOES work:

Name plural: Donates
Name singular: Donate
Slug: donate
custom permission: read_private_donates

I also had other post types with multiple words. If you want multiple words, it seems you must use underscores.

Example that does work:

Name plural: Pages_Simple
Name singular: Page_Simple
Slug: simple
custom permission: read_private_pages_simple

I wish it was possible to use spaces in "Name plural" and have them converted to underscores for the permission, but at least this works.

I hope this helps someone else. Thanks again!

#1627137

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Hello and thank you for your feedback.
I can ask our system team to make this reply part of your previous post, or we can just add a reference to this ticket on your previous one. If you still need this reply to be part of the previous ticket, let me know and I'll ask for it on Tuesday.
In the meantime, I'll add a message to the previous thread.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.