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 :-(.
I was drinking some excellent Belgian beers called Chimay last night and didn't see the obvious solution. As the action works in the script that recieves the form data, all I needed to get the Custom Value data was a $_POST['valuename'] statement.
doncqueurs
Member
Posted 2 years ago #
I like Grimbergen Triple better, but good that you found it!