protected function bookInfoPid() {

		$post = ( new Metadata() )->getMetaPost();
		if ( empty( $post->ID ) ) {
			$new_post = [
				'post_title' => __( 'Book Info', 'pressbooks' ),
				'post_type' => 'metadata',
				'post_status' => 'publish',
			];
			$pid = wp_insert_post( add_magic_quotes( $new_post ) );
		} else {
			$pid = $post->ID;
		}

		return $pid;
	}
protected function bookInfoPid() {

		$post = ( new Metadata() )->getMetaPost();
		if ( empty( $post->ID ) ) {
			$new_post = [
				'post_title' => __( 'Book Info', 'pressbooks' ),
				'post_type' => 'metadata',
				'post_status' => 'publish',
			];
			$pid = wp_insert_post( add_magic_quotes( $new_post ) );
		} else {
			$pid = $post->ID;
		}

		return $pid;
	}
protected function bookInfoPid ( ) { $ post = ( new Metadata ( ) ) -> getMetaPost ( ) ; if ( empty ( $ post -> ID ) ) { $ new_post = [ 'post_title' => __ ( 'Book Info' , 'pressbooks' ) , 'post_type' => 'metadata' , 'post_status' => 'publish' , ] ; $ pid = wp_insert_post ( add_magic_quotes ( $ new_post ) ) ; } else { $ pid = $ post -> ID ; } return $ pid ; }
Get existing Meta Post, if none exists create one

@return int Post ID
Get existing Meta Post if none exists create one