I was wondering if there is a way to make this code limit by category. In other words, if user A has already published 10 posts in category A then he can keep the new ones as drafts in category A or post another 10 in category B. * * @param array $data An array […]
Categories
How to limit posts by category
- Post author By Marcia D.
- Post date February 23, 2021
- No Comments on How to limit posts by category
- Tags 'author' => $user_id, 'fields' => 'ids', 'kia_limit_posts', 'monthnum' => date( 'm' ), 'post_status' => 'publish', // Whatever the current month is ) ); $author_post_count = $author_posts = $author_posts->post_count + 1; // Add current p, $postarr ) { if ( isset( $data['post_type'] ) && 'post' === $data['post_type'] ) { $posts_per_month = 10; // Could be set as an, 10, 2 ); Thank you in advance., and processed post data. * @param array $postarr An array of sanitized (and slashed) but otherwise unmodified post data. * @see h, I was wondering if there is a way to make this code limit by category. In other words, if user A has already published 10 posts in category A then he can keep the new ones as drafts in category A or post another 10 in category B, sanitized