I’m developing a database the addresses utilizing the place addon inside a custom post type. The post title is not pertinent to this custom article type, therefore it has been disabled. Ns would, however, choose to be able to show the many recent ar in the various locations that WP would certainly normally present a short article title without having to re-code sections of the admin (or addons such as the partnership module i beg your pardon defaults come showing post title in results). For this reason I’m attempting to press the attend to from the ACF place addon come the article title on short article save/update.
The password I’ve created so much only functions on short article update due to the fact that there are existing worths in the DB for ACF fields, however for this factor it’s of food pushing old data come the article title:
add_filter( 'wp_insert_post_data', 'change_incident_title' );function change_incident_title( $post_data ) if($post_data<'post_type'> == 'incident') $location = get_field('address',$post_data<'ID'>); $post_data<'post_title'> = $location<'address'>; return $post_data; What I’m wondering is if there is any type of known method to access current ACF data for a short article inside the wp_insert_post_data filter before everything is saved to the DB?
You are watching: Wp_insert_post_data
September 11, 2013 at 6:25 am
Whoops, must’ve thought of much better terms to search for this time together I simply stumbled across something that will certainly hopefully at least overview me in the ideal direction:
September 11, 2013 at 2:17 pm
Thanks for searching and for posting the link
Viewing 3 short articles - 1 through 3 (of 3 total)
See more: Which Of The Following Is A Nucleotide Found In Dna ? Dna Explained: Structure And Function
The object ‘Access ar data inside 'wp_insert_post_data' filter?’ is closeup of the door to brand-new replies.
Welcome to the progressed Custom Fields neighborhood forum.
Browse through ideas, snippets the code, questions and answers between fellow ACF users