You’re using an old version of WordPress. Upgrade to 3.5 and you will no longer see that error.
Here’s the function declaration for get_post
in WP 3.4:
function &get_post(&$post, $output = OBJECT, $filter="raw")
Notice the ampersand in front of $post
? That would mean the value is passed by reference. You can give the function a literal, it has to be the variable.
The correct solution is to update to WP 3.5 (we’re on 3.5.1 at the time of writing). Get post to WP 3.5+:
function get_post( $post = null, $output = OBJECT, $filter="raw" )
The less good way is to simply cheat when you call the function and do an assignment + call at the same time:
$a_post = get_post($a_post_id = 439);
$a_post_id = 439
in the function arguments creates the $a_post_id
variable and pass it into the function.