WordPress.org

Ready to get started?Download WordPress

Forums

Way to limit # of posts per category posted (not shown) (2 posts)

  1. midwestmedia
    Member
    Posted 1 year ago #

    Hi there,

    I'm looking for a way to limit how many posts can be added to a sub-category after which, if someone tried to post one more than allowed, would be greeted with a message or redirect to a page explaining why posts are limited in that category.

    It's an attempt at hacking a directory theme/plugin to make it so that I can limit the absolute number of listings in each sub-category. I know how to limit how many are shown in each category but I want to limit actual postings full-stop before they even get a chance to be added to the database.

    I'm in over my head on this one. Can someone help get me started (or, if you know of a plugin that might work)?

  2. Scott Fennell
    Member
    Posted 1 year ago #

    Are you familiar with the hooks API?

    You'd have to write a function that hooked onto

    http://codex.wordpress.org/Function_Reference/wp_insert_post

    And checked to make sure the number of posts in the category was allowable.

Topic Closed

This topic has been closed to new replies.

About this Topic