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
Called by
1 to 7 of 7
- bw_code() – Display information about a specific shortcode
- bw_current_post_id() – Set/return the current post ID
- bw_navi_fetch_field_content() – Load the requested page for the field
- bw_parent() – Display a link to the post->parent
- bw_posts() – Create a simple list of posts, defaulting to recent posts if no parms specified
- bw_tree() – Implements [bw_tree] shortcode
- _bw_get_an_id() – Return a post ID for bw_link example
