handling location and date for post title updater
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e7fee252e4
commit
dff2a50c35
|
|
@ -42,16 +42,15 @@ function metiers_patrimoine_chantiers_post_updater($post_id)
|
||||||
|
|
||||||
if (!$artisan || !$chantier_name) return;
|
if (!$artisan || !$chantier_name) return;
|
||||||
|
|
||||||
$my_post['post_title'] = "";
|
$title = $artisan->post_title . " | " . $chantier_name;
|
||||||
$title = $artisan . " | " . $chantier_name;
|
|
||||||
|
|
||||||
if ($localisation) {
|
if ($localisation && isset($localisation['city'])) {
|
||||||
$title .= " | " . $localisation;
|
$title .= " | " . $localisation['city'];
|
||||||
}
|
}
|
||||||
if ($date) {
|
if ($date) {
|
||||||
// $title .= " | " . ;
|
$title .= " | " . $date;
|
||||||
}
|
}
|
||||||
|
$my_post['post_title'] = $title;
|
||||||
wp_update_post($my_post);
|
wp_update_post($my_post);
|
||||||
}
|
}
|
||||||
add_action('acf/save_post', 'metiers_patrimoine_chantiers_post_updater', 20);
|
add_action('acf/save_post', 'metiers_patrimoine_chantiers_post_updater', 20);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user