Post ID within publish_post action
-
I’m trying to get a custom value from a post (get_post_meta($post->ID, “Overlay”, true);
) when it’s published (add_action(‘publish_post’, ‘wm_addoverlay’);).I need the post ID for that. How can I get it?
I tried $post_ID, $post->ID, $_POST[‘id’], $_POST[‘ID’] and global $ID, but they don’t work :-(.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Post ID within publish_post action’ is closed to new replies.