Support

Account

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?