September 11, 2013 at 6:15 am

I’m developing a database of addresses utilizing the location addon inside a custom short article form. The write-up title is not pertinent to this custom article kind, so it has actually been disabled. I would, yet, favor to be able to show the most current area in the various locations that WP would certainly normally show a write-up title without having to re-code parts of the admin (or addons such as the partnership module which defaults to reflecting write-up title in results). Therefore I’m attempting to push the attend to from the ACF area addon to the write-up title on article save/upday.

The code I’ve created so much just functions on short article update because there are existing worths in the DB for ACF fields, yet therefore it’s of course pushing old information to the short article title:

add_filter( 'wp_insert_post_data', 'change_incident_title' );attribute change_incident_title( $post_information ) if($post_data<'post_type'> == 'incident') $area = get_field('address',$post_data<'ID'>); $post_data<'post_title'> = $location<'address'>; rerevolve $post_data; What I’m wondering is if tbelow is any well-known way to accessibility current ACF information for a post inside the wp_insert_post_information filter before everything is conserved to the DB?




You are watching: Wp_insert_post_data

*

September 11, 2013 at 6:25 am

Whoops, must’ve believed of much better terms to search for this time as I simply stumbled across something that will hopetotally at least guide me in the appropriate direction:

http://assistance.advancedcustomareas.com/forums/topic/set-custom-post-type-title-by-acf/


*

*

September 11, 2013 at 2:17 pm

Hi
denny

Thanks for searching and for posting the link

Great work

ThanksE


Viewing 3 write-ups - 1 with 3 (of 3 total)


See more: Which Of The Following Is A Nucleotide Found In Dna ? Dna Explained: Structure And Function

The topic ‘Access area data inside 'wp_insert_post_data' filter?’ is closed to new replies.


Welpertained to the State-of-the-art Custom Fields community forum.

Browse with principles, snippets of code, inquiries and also answers between fellow ACF users