_bw_get_an_id() – bw get an id

You appear to be a bot. Output may be restricted

Description

Return a post ID for bw_link example

If the global post ID is not set try for a recently published post ID

Usage

$integer = _bw_get_an_id();

Parameters

Returns

integer ID

Source

File name: oik/shortcodes/oik-link.php
Lines:

1 to 13 of 13
function _bw_get_an_id() {
  oik_require( "includes/bw_posts.php" );
  $id = bw_global_post_id();
  if ( !$id ) {
    $posts = wp_get_recent_posts( array( "numberposts" => 1, "post_status" => "publish", "post_type" => "page" ) );
    $post = bw_array_get( $posts, 0, null );
    if ( $post )
      $id = $post['ID'];
      
    // bw_trace2( $posts );  
  } 
  return( $id );
}
 

 View on Trac