I created a meta box and I need to get the id of the current post as a value with the parameter 'attributes' :
array( 'id' => $prefix . 'hidden_postid', 'type' => 'hidden', 'attributes' => array( 'value' => $post_id, ) ),
First I used this :
global $post; $post_id = $post->ID;
But it doesn't seem to work.
The function get_the_ID() doesn't work either however I use the 'value' => date() for another field and it's working...
Thank you 🙂