I'm adding a box to add / update post screen.
add_action( 'save_post', 'psd_upload_kaydet' );
add_action( 'add_meta_boxes', 'psd_upload' );
function psd_upload()
{
add_meta_box("psd-upload", "Bir Dosya Upload Edin", "psd_upload_box", "post");
}
function psd_upload_box($post)
{
echo "content here";
}
function psd_upload_kaydet($post_id)
{
die($post_id); // for debugging, i'll explain it
}
There is no error while adding box, but normally, when post saved, add_action( 'save_post', 'psd_upload_kaydet' );
will pass post id as an argument to psd_upload_kaydet()
But it's not passing post it to psd_upload_kaydet()
as an argument. I'm checking it die($post_id);
, but it's returning just blank page.
In shortly, I need post id in psd_upload_kaydet()
:)