In my theme functions file put the following code
//CADASTRO DE CURRICULUNS PELO CLIENTE
function cadastra_curriculuns( $post_id )
{
// check if this is to be a new post
if( $post_id != 'new' )
{
return $post_id;
}
// Create a new post
$post = array(
'post_status' => 'draft' , //Salva como rascunho
'post_title' => '$nome' , //Titulo do Post
'post_type' => 'post' , //Onde vai gravar, neste caso no Custon Post Type = Movie
);
// insert the post
$post_id = wp_insert_post( $post );
// update $_POST['return']
$_POST['return'] = add_query_arg( array('post_id' => $post_id), $_POST['return'] );
// return the new ID
return $post_id;
}
add_filter('acf/pre_save_post' , 'cadastra_curriculuns' );
Works right so that does not write the variable $ name in the wordpress dashboard.
‘post_title’ => ‘$ name’, / / Title of Post
What am I doing wrong in this line?