Home › Forums › Front-end Issues › How do you create post_title from another field(s) in ACF Pro? › Reply To: How do you create post_title from another field(s) in ACF Pro?
Just messing around here. I ran this to see where the Post Title and Post Content are getting passed.
add_filter('acf/pre_save_post' , 'cca_pre_save_post', 10, 1 );
function cca_pre_save_post( $post_id )
{
$_POST['acf']['field_5419e3b4411cc'] = print_r( $_POST, true ); // textarea in form
return $post_id;
}
And this was returned:
Array
(
[_acfnonce] =>
[_acfchanged] => 1
[acf] => Array
(
[field_5419e384411cb] => The Business Name
[field_5419e3b4411cc] =>
[field_5419de9b4834f] => The Buisiness name
[field_5419deb048350] =>
[field_5419df0348353] =>
[field_5419dee748352] =>
[field_5419e441411ce] =>
[field_5419e457411cf] =>
[field_5419e47e411d0] =>
[field_5419e4bb411d1] =>
[field_5419e4c8411d2] =>
[field_5419e4eb411d3] =>
[field_5419e520411d4] =>
[field_54258b963546b] =>
[field_542490cc4e78f] =>
[field_54258cb962f62] =>
[field_5425c8a5fbebe] => 1
)
)
Which, as you can see, doesn’t include either the Post Title or Post Content. However, looking at the Form Data in Dev Tools in Chrome, this is what’s getting passed:
acf[_post_title]:The Post Title
acf[_post_content]:
acf[field_5419e384411cb]:The Business Name
acf[field_5419e3b4411cc]:
acf[field_5419de9b4834f]:The Buisiness name
acf[field_5419deb048350]:
acf[field_5419df0348353]:
acf[field_5419dee748352]:
acf[field_5419e441411ce]:
acf[field_5419e457411cf]:
acf[field_5419e47e411d0]:
acf[field_5419e4bb411d1]:
acf[field_5419e4c8411d2]:
acf[field_5419e4eb411d3]:
acf[field_5419e520411d4]:
acf[field_54258b963546b]:
acf[field_542490cc4e78f]:
acf[field_54258cb962f62]:
acf[field_5425c8a5fbebe]:1
So … where does ‘_post_title’ go?
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!
ACF PRO’s Flexible Content field allows you to create smaller pieces of UI and compose them into whole flexible patterns. In our latest article, we show how to use it to create swappable site sections and integrate it all in a theme.https://t.co/ZRocH8oJSp
— Advanced Custom Fields (@wp_acf) January 24, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.