Ask your WordPress questions! Pay money and get answers fast! (more info)

Only 1 custom post per category WordPress

  • CLOSED

1. I'm looking for a function that will allow me to block a custom post being published if it's category has already been assigned to a previous custom post.

2. I want this function wrapped up in a hook/action to be used with WP Front End User Pro (https://docs.wedevs.com/docs/wp-user-frontend-pro/developer-docs/).

Answers (2)

2017-03-04

Arnav Joy answers:

can you please explain more about your requirement and also show me the site/url ?

2017-03-07

Rempty answers:

Hello
The 2 usable hooks are triggered after the post is created, maybe you need to find another approach,
if the user save the post with X category(with assigned post) instead of status published save with status draft