get_terms on save_post hook

Usually, if I want to check for some attribute of the post I’m about to publish, I will check like this: $post_title = $_POST[‘post_title’]; post_title is the name of the title field in the edit window. I thought I’d apply the same logic to the taxonomy meta box. $formats = $_POST[‘tax_input[formats][]’]; Essentially, I’m trying to … Read more

Limit number of posts a user can make per minute?

So I found the solution to limiting a number of posts a user can make per day but not per minute. Here’s an excerpt from the code I found on http://wordpress.org/support/topic/limit-the-number-of-posts-a-user-can-make?replies=18 //limit the quantity to N posts $N = 20; max 20 posts por usuario $count_posts = count(get_posts(array(‘author’=>$user_ID)));// returns the quantity of written posts by … Read more

Action on post publish

I want to do something when a post is published (doesn’t matter if updated [draft -> publish] or just created) In my plugin I tried different actions to try this. I tried the following code to detect when which event is triggered: function new_post() { file_put_contents(‘debug.log’, ‘new_post’, FILE_APPEND); } function publish_post() { file_put_contents(‘debug.log’, ‘publish_post’, FILE_APPEND); … Read more