protected function importPbPostMeta( $pid, $p ) {

		$data_model = $this->figureOutDataModel( $p['postmeta'] );

		$meta_to_update = apply_filters( 'pb_import_metakeys', [ 'pb_section_license', 'pb_short_title', 'pb_subtitle', 'pb_show_title' ] );
		foreach ( $meta_to_update as $meta_key ) {
			$meta_val = $this->searchForMetaValue( $meta_key, $p['postmeta'] );
			if ( $meta_val ) {
				update_post_meta( $pid, $meta_key, $meta_val );
				if ( $meta_key === 'pb_section_license' ) {
					wp_set_object_terms( $pid, $meta_val, Licensing::TAXONOMY ); // Link
				}
			}
		}

		if ( $data_model === 5 ) {
			$meta_val = $this->searchForMetaValue( 'pb_authors', $p['postmeta'] );
			if ( $meta_val ) {
				// PB5 contributors (slugs)
				add_post_meta( $pid, 'pb_authors', $meta_val );
				wp_set_object_terms( $pid, $meta_val, Contributors::TAXONOMY );
			}
		} else {
			$meta_val = $this->searchForMetaValue( 'pb_section_author', $p['postmeta'] );
			if ( $meta_val ) {
				// PB4 contributors (full names)
				$this->contributors->convert( 'pb_section_author', $meta_val, $pid );
			}
		}
	}
protected function importPbPostMeta( $pid, $p ) {

		$data_model = $this->figureOutDataModel( $p['postmeta'] );

		$meta_to_update = apply_filters( 'pb_import_metakeys', [ 'pb_section_license', 'pb_short_title', 'pb_subtitle', 'pb_show_title' ] );
		foreach ( $meta_to_update as $meta_key ) {
			$meta_val = $this->searchForMetaValue( $meta_key, $p['postmeta'] );
			if ( $meta_val ) {
				update_post_meta( $pid, $meta_key, $meta_val );
				if ( $meta_key === 'pb_section_license' ) {
					wp_set_object_terms( $pid, $meta_val, Licensing::TAXONOMY ); // Link
				}
			}
		}

		if ( $data_model === 5 ) {
			$meta_val = $this->searchForMetaValue( 'pb_authors', $p['postmeta'] );
			if ( $meta_val ) {
				// PB5 contributors (slugs)
				add_post_meta( $pid, 'pb_authors', $meta_val );
				wp_set_object_terms( $pid, $meta_val, Contributors::TAXONOMY );
			}
		} else {
			$meta_val = $this->searchForMetaValue( 'pb_section_author', $p['postmeta'] );
			if ( $meta_val ) {
				// PB4 contributors (full names)
				$this->contributors->convert( 'pb_section_author', $meta_val, $pid );
			}
		}
	}
protected function importPbPostMeta ( $ pid , $ p ) { $ data_model = $ this -> figureOutDataModel ( $ p [ 'postmeta' ] ) ; $ meta_to_update = apply_filters ( 'pb_import_metakeys' , [ 'pb_section_license' , 'pb_short_title' , 'pb_subtitle' , 'pb_show_title' ] ) ; foreach ( $ meta_to_update as $ meta_key ) { $ meta_val = $ this -> searchForMetaValue ( $ meta_key , $ p [ 'postmeta' ] ) ; if ( $ meta_val ) { update_post_meta ( $ pid , $ meta_key , $ meta_val ) ; if ( $ meta_key === 'pb_section_license' ) { wp_set_object_terms ( $ pid , $ meta_val , Licensing :: TAXONOMY ) ; // Link } } } if ( $ data_model === 5 ) { $ meta_val = $ this -> searchForMetaValue ( 'pb_authors' , $ p [ 'postmeta' ] ) ; if ( $ meta_val ) { // PB5 contributors (slugs) add_post_meta ( $ pid , 'pb_authors' , $ meta_val ) ; wp_set_object_terms ( $ pid , $ meta_val , Contributors :: TAXONOMY ) ; } } else { $ meta_val = $ this -> searchForMetaValue ( 'pb_section_author' , $ p [ 'postmeta' ] ) ; if ( $ meta_val ) { // PB4 contributors (full names) $ this -> contributors -> convert ( 'pb_section_author' , $ meta_val , $ pid ) ; } } }
Import Pressbooks specific post meta

@param int $pid Post ID
@param array $p Single Item Returned From \Pressbooks\Modules\Import\WordPress\Parser::parse
Import Pressbooks specific post meta