Created
March 13, 2015 18:35
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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