- This topic has 10 replies, 2 voices, and was last updated 1 month, 1 week ago by .
-
Topic
-
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 🙂
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- You must be logged in to reply to this topic.