Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

lachender_engel on "Limit for Custom Post"

$
0
0

Hello Guys.

I hope I can get a solution from you for the following issue:
I use Polylang to get a multilingual web site. This works perfect.
Additional I’ve created a custom post type with Polylang support. Works also very nice. And I use custom roles with capabilities to give a role the right to add a new custom post and save it. Everything works as expected.

Now, I would like to add a limit to allow the role to add only one post per language.

For this I wrote a function which checks how many languages are activated and how many posts in which language are already saved for the customer. One goal is to disable the “new post” button on the top of the list where Wordpress shows all custom posts. The second goal is to disable or hide the “save” button on the edit page.

Now, my questions are:
1.) Where can I call the function to check the posts? Is there any hook (or some other place) which is called before Wordpress shows the list of the custom posts?

2.) How can I disable or switch off the “new post” at the top of this list? Important is, I have to do it without Java Script (jQuery) to prevent the user disables JS and can add an additional post.

3.) How can I disable or hide the save button on the edit screen/dialog, also without jQuery?

Hope I made clear what I need and I hope more, you can give me a hint or the solution ;-)

Thanks a lot in advance!


Viewing all articles
Browse latest Browse all 8245

Trending Articles