Skip to content

Instantly share code, notes, and snippets.

@carfis
Created March 13, 2015 18:35
Show Gist options
  • Save carfis/44ce38b79098e2e7116a to your computer and use it in GitHub Desktop.
Save carfis/44ce38b79098e2e7116a to your computer and use it in GitHub Desktop.
Function change the Post Title and Custom Taxonomy with ACF Front Page Form
// check if this is to be a new post
if( $post_id != 'new' )
{
if (get_the_title($post_id) != $_POST['acf']['field_5434172d1d00f'] ){
$update_post = array(
'ID' => $post_id,
'post_title' => $_POST['acf']['field_5434172d1d00f']
);
// Update the post into the database
wp_update_post( $update_post );
}
$longterms = vo_bundesland_langeform($_POST['acf']['field_5437aa29f0857']);
wp_set_object_terms( $post_id, $longterms , 'bundesland');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment