0
My problem is this, I created a custom post type called "Home Highlights" and within it the user will add the post you want, these posts come from a select_advanced of Metabox, I made a function to pass the post selected to the title of the current post, but it ends up returning a number I do not know why.
Follow my function and some prints to help in understanding:
add_filter( 'the_title', 'teste', 10, 2 );
function teste( $title, $post_id )
{
if( $new_title = get_post_meta( get_the_ID(), 'id_do_metabox', true ) )
{
return $new_title;
}
return $title;
}