static function getFirst( $return_post_id = false, $admin_mode = false ) {

		global $blog_id;

		$book_structure = static::getBookStructure();
		$order = $book_structure['__order'];
		$pos = array_keys( $order );

		reset( $pos );
		while ( $first_id = current( $pos ) ) {
			if ( $admin_mode ) {
				if ( current_user_can( 'edit_post', $first_id ) ) {
					break;
				} else {
					next( $pos );
				}
			} else {
				if ( in_array( $order[ $first_id ]['post_status'], [ 'publish', 'web-only' ], true ) ) {
					break;
				} elseif ( current_user_can_for_blog( $blog_id, 'read_private_posts' ) ) {
					break;
				} elseif ( get_option( 'permissive_private_content' ) && current_user_can_for_blog( $blog_id, 'read' ) ) {
					break;
				} else {
					next( $pos );
				}
			}
		}

		if ( $return_post_id ) {
			return (int) $first_id;
		} else {
			return ( empty( $first_id ) ) ? '/' : get_permalink( $first_id );
		}

	}
static function getFirst( $return_post_id = false, $admin_mode = false ) {

		global $blog_id;

		$book_structure = static::getBookStructure();
		$order = $book_structure['__order'];
		$pos = array_keys( $order );

		reset( $pos );
		while ( $first_id = current( $pos ) ) {
			if ( $admin_mode ) {
				if ( current_user_can( 'edit_post', $first_id ) ) {
					break;
				} else {
					next( $pos );
				}
			} else {
				if ( in_array( $order[ $first_id ]['post_status'], [ 'publish', 'web-only' ], true ) ) {
					break;
				} elseif ( current_user_can_for_blog( $blog_id, 'read_private_posts' ) ) {
					break;
				} elseif ( get_option( 'permissive_private_content' ) && current_user_can_for_blog( $blog_id, 'read' ) ) {
					break;
				} else {
					next( $pos );
				}
			}
		}

		if ( $return_post_id ) {
			return (int) $first_id;
		} else {
			return ( empty( $first_id ) ) ? '/' : get_permalink( $first_id );
		}

	}
static function getFirst ( $ return_post_id = false , $ admin_mode = false ) { global $ blog_id ; $ book_structure = static :: getBookStructure ( ) ; $ order = $ book_structure [ '__order' ] ; $ pos = array_keys ( $ order ) ; reset ( $ pos ) ; while ( $ first_id = current ( $ pos ) ) { if ( $ admin_mode ) { if ( current_user_can ( 'edit_post' , $ first_id ) ) { break ; } else { next ( $ pos ) ; } } else { if ( in_array ( $ order [ $ first_id ] [ 'post_status' ] , [ 'publish' , 'web-only' ] , true ) ) { break ; } elseif ( current_user_can_for_blog ( $ blog_id , 'read_private_posts' ) ) { break ; } elseif ( get_option ( 'permissive_private_content' ) && current_user_can_for_blog ( $ blog_id , 'read' ) ) { break ; } else { next ( $ pos ) ; } } } if ( $ return_post_id ) { return ( int ) $ first_id ; } else { return ( empty ( $ first_id ) ) ? '/' : get_permalink ( $ first_id ) ; } }
Select the very first post in a book. May be a chapter or a front matter post

@param bool $return_post_id (optional)
@param bool $admin_mode (optional)

@return mixed URL of first post, or Post ID if $return_post_id is set to true
Select the very first post in a book . May be a chapter or a front matter post