Description
Return the global post ID and, if different global id, for tracing
Usage
$string = bw_get_post_id();Parameters
Returns
string $post->ID and, if different "<>"$idSource
File name: oik-bwtrace/includes/bwtrace.phpLines:
1 to 25 of 25
function bw_get_post_id() { $post_id = 0; $id = 0; if ( isset( $GLOBALS['post'] )) { if ( !is_wp_error( $GLOBALS['post']->ID ) ){ $post_id=$GLOBALS['post']->ID; } else { print_r( $GLOBALS['post']); } } else { $post_id = 0; } if ( isset( $GLOBALS['id'] ) ) { if ( !is_wp_error( $GLOBALS['id'] ) ) { $id=$GLOBALS['id']; } } if ( $id <> $post_id ) { if ( is_scalar( $id ) ) { $post_id .= "<>" . $id; } } return( $post_id ) ; }View on GitHub View on Trac
