Support

Account

Home Forums General Issues Set custom post type title by acf? Reply To: Set custom post type title by acf?

  • Hi @elbowpham

    I would fist look at the varible $data and find out what you can play with. This is more commonly known as variable ‘debugging’. You can do this like so:

    
    <?php 
    
    echo '<pre>';
    	print_r($data);
    echo '</pre>';
    die;
    
     ?>
    

    Using this code will display the contents of $data.
    You should see that the custom field value is something like:

    
    $data['fields']['field_1235678']
    

    The field_1235678 is the field_key which you can find from the field edit screen, or simply just figure it out from the posted $data

    Cheers
    E