我正在添加一个框到“添加/更新帖子”屏幕。
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
}
添加框时没有错误,但通常在post保存时,
add_action( \'save_post\', \'psd_upload_kaydet\' );
将通过
post id 作为
psd_upload_kaydet()
但它并没有传递给psd_upload_kaydet()
作为论据。我正在检查die($post_id);
, 但它返回的只是空白页。
很快,我需要post id 在里面psd_upload_kaydet()
:)