I need to know the id of the post current not the id of the attachment.
function add_filter_upload_image($attachment_id){
// code filter
}
add_filter('add_attachment', 'add_filter_upload_image', 10, 1);
I've tried with all these ways and none works.
- global $post; echo $post->id;
- $post_id = $_GET['post'];
- $post_id = $_POST['post'];
- $post_id = $_REQUEST['post_id'];
Any ideas please?