You appear to be a bot. Output may be restricted
Description
Return the global post IDIn WordPress 4.9 new logic hides the globals $post from widgets.
Usage
$ID = bw_global_post_id();
Parameters
Returns
ID the global post ID or 0Source
File name: oik/libs/bobbfunc.phpLines:
1 to 10 of 10
function bw_global_post_id() { if ( isset( $GLOBALS['post'] )) { $post_id = $GLOBALS['post']->ID; } elseif ( isset( $GLOBALS['id'] ) ) { $post_id = $GLOBALS['id']; } else { $post_id = 0; } return( $post_id ) ; }View on GitHub View on Trac