Hello,
I have a post type on my site called classified
Please how can I restrict access to the classified post type based on the total number of published blog post of a logged in user.
The user must have published minimum of 5 blog posts before they can view or access classifieds on the site.
When the user try to view or access a classified they will see this error message (Hello -username-, you need to publish at least 5 high quality articles before you can view this classified)
I am using a frontend editor plugin for user generated content
Thanks
Hi Tosin,
Since the plugin involved are not related to us, I will suggest contacting the front end plugin’s team for the assistance.Regards
BrajeshHello Brajesh,
I am not reffering to a specific plugin, I don’t have any classified plugin installed, but im reffering to any custom post type that will be created, the earlier classified was just used as an example of a custom post type, it could be any custom post type. e.g reviews, books, cars etc
Thanks
Hi Tosin,
If you are looking for conditions then here is an exampleif ( count_user_posts( get_current_user_id(), 'your_post_type' ) > 10 ) { // do something. }
Change the post type and count.
Rest of the implementation details you will need to handle.
Regards
Brajesh
You must be logged in to reply to this topic.