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
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.