Support » Plugins » accessing post data with hooks

  • Resolved themarco

    (@themarco)


    Ok this may sound like a complicated question. I do hope however that someone will be able to answer it. What I need to do is the following:

    • When saving a NEW post I need access to the content and the ID of that post right AFTER posting it.
    • When editing a post I need access to the content and ID of that post right AFTER editing it.
    • When deleting a post I need access to the content and the ID of that post right BEFORE deleting it.

    Can someone tell me which plugin action hooks to use and which (global) variables will contain the data I need?

    I assume I need to use:

    add_action(‘publish_post’, ‘function’);
    add_action(‘delete_post’, ‘other_function’);

    However I have no clue how to access the data I want to access as described above in function() and other_function().

    Can anyone tell me?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘accessing post data with hooks’ is closed to new replies.