Metabox Populated with a Custom Post Type – How to Output CPT based on Select?

If you set the value of the metabox to the authors cpt post id, you should be able to get the post with

//get the id for the actors cpt
$actors_id   = get_post_meta( $post->ID, 'nt_getactors', true );

//get the post obejct for the author
$actors_post = get_post( $actors_id, OBJECT ); //or ARRAY_A if you want an array and not an object

//to output e.g. the title use
$actors_post->post_title;

See get_post for further options.

Update

Change

$post_options [ $post->post_title ] = $post->post_title;

to

$post_options [ $post->ID ] = $post->post_title;

Update 2

Use your $actors_post post object just like a normal post object. Check the codex for a nice reference of the available member variables.

e.g.

$actors_post->post_content;

Keep in mind that $actors_post data is “raw” and you might want to apply some filters to it, depending on how you are using it; e.g.

apply_filters( 'the_content', $actors_post->post_content );

Update 3

In order to get meta values from the actor post either do this for a single value

get_post_meta( $actor_post->ID, 'ecpt_bio', true );

or (if you have multiple values you can get them all in one array) like this:

$actor_meta = get_post_meta( $actor_post->ID );
//and then access the array element
echo $actor_meta['ecpt_bio'];

Wrap up

Change your callback function to reference the id of the post instead of the title (see Update#1)

//get the id for the actors cpt
$actors_id   = get_post_meta( $post->ID, 'nt_getactors', true );

//get the post obejct for the author
$actors_post = get_post( $actors_id, OBJECT );

//to output e.g. the title use
echo apply_filters( 'the_title', $actors_post->post_title );

//output the content
echo apply_filters( 'the_content', $actors_post->post_content );

//get the meta values from the actor post
$actor_meta = get_post_meta( $actor_post->ID );

//and output it like this
echo $actor_meta[ 'ecpt_bio' ];

deneme bonusudeneme bonusu veren sitelerpulibet girişOnwin Güncel Giriştürkçe altyazılı pornocanlı bahis casino