Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

What I need to do is inspect the content of the post and title and based on the inspection, redirect to a different page. To do this, I need to know if a "POST" action is for saving a post. How to detect this?

share|improve this question
add comment

1 Answer

Take a look at the Plugin API/Action Reference: Actions Run During an Admin Page Request..

Then add something simple to the appropriate hook:

function wpse19260_inspect_post()
{
    echo '<pre>';
        // print_r( $_POST );
        echo $_POST->ID;
        echo $_POST->post_content;
        echo $_POST->post_title
    echo '<pre>';
}
add_action( 'publish_post', 'wpse19260_inspect_post' );
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.