The MU forums have moved to WordPress.org

Problem with publish_post hook (4 posts)

  1. easysleeper
    Member
    Posted 14 years ago #

    this seems to only run when a post is published if the status is set to publish. I need a hook that will run when a post is published NO MATTER WHAT the status is, (i.e. private)

    if there isn't one, does anyone know where this hook is activated so I can create a new one?

    thanks

  2. cafespain
    Member
    Posted 14 years ago #

    add_action('save_post', 'function_here', 9 , 2);

    If passes in post_id and post. Check post->status for the status of the post ('publish', 'private, 'future', etc)

  3. easysleeper
    Member
    Posted 14 years ago #

    I'll give that a shot, I REALLY appreciate the help! I had just taken my function call into post.php and was going to try and find the right spot for it to call from.

  4. easysleeper
    Member
    Posted 14 years ago #

    That seems to do it! although I have to block 'draft' and 'inherit' post status, once I block those I am getting nothing but publish, private, friend, and loggedin which is what I was hoping for!

    thanks a lot!

About this Topic

  • Started 14 years ago by easysleeper
  • Latest reply from easysleeper