Skip to content

Instantly share code, notes, and snippets.

@danielpowney
Created January 19, 2015 06:28
Show Gist options
  • Save danielpowney/7837173ee6ab725a0527 to your computer and use it in GitHub Desktop.
Save danielpowney/7837173ee6ab725a0527 to your computer and use it in GitHub Desktop.
<?php
global $post;
if (!isset($post_id) isset($post)) {
$post_id = $post->ID;
}
?>
@chazzzzy
Copy link

Is this code correct? Should it be: if (!isset($post_id) && isset($post)) {... or something between the two issets? Or maybe I'm incorrect?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment