如果$a
包含某个帖子的ID,如何获取相应的作者ID?我试过了
$b = get_post( $a);
$c = $b->post_author;
$d = $c->ID;
但它不起作用。
最合适的回答,由SO网友:Oleg Butuzov 整理而成
$b = get_post( $a);
// post_author already contain author ID.
//So you can assign author\'s ID to $c same as to $d
$c = $d = $b->post_author;