wp_insert_post_data won't update meta and shows white screen
-
Hello
I am trying to update a custom field with some data that I collect in the CFDB plugin. I can see all my data correctly if I use die() before the actual update_post_meta call. Here’s my code:
add_filter( 'wp_insert_post_data' , 'modify_post_title' , '99', 2 ); function modify_post_title( $data , $postarr ) { if($data['post_type'] == 'pets') { // Get all the email addresses associated with this pet that has sponsored $graciousSponsors = do_shortcode('[cfdb-value form="Untitled" show="Extra2" filter="PetName='.$data['post_title'].'"]'); //die ($graciousSponsors." , ".$postarr['ID']." , ".join(", ",explode(", ", $graciousSponsors))); // Now set the custom field's value to the list of email addresses update_post_meta ($postarr['ID'], 'sponsor_emails', join(", ",explode(", ", $graciousSponsors)), false); } return $data; }
the die() call shows me all of my information correctly. ANy help would be appreciated. ??
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘wp_insert_post_data won't update meta and shows white screen’ is closed to new replies.