Compare commits
4 Commits
5c76654755
...
38a7fac143
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38a7fac143 | ||
|
|
98f628a05a | ||
|
|
5d14c64fa8 | ||
|
|
8a0065e1c6 |
|
|
@ -13,7 +13,7 @@
|
||||||
<?php wp_head(); ?>
|
<?php wp_head(); ?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body <?php body_class("front-end"); ?>>
|
<body <?php body_class("front-end is-website-dynamiques"); ?>>
|
||||||
<?php
|
<?php
|
||||||
do_action('tailpress_site_before');
|
do_action('tailpress_site_before');
|
||||||
global $post;
|
global $post;
|
||||||
|
|
|
||||||
|
|
@ -44,19 +44,74 @@ function dynamiques_save_auteurs_post($post_id)
|
||||||
{
|
{
|
||||||
$post_type = get_post_type($post_id);
|
$post_type = get_post_type($post_id);
|
||||||
|
|
||||||
if ($post_type == 'auteurs') {
|
if ($post_type !== 'auteurs') return;
|
||||||
$first_name = get_field('first_name', $post_id) ?? '';
|
|
||||||
$last_name = get_field('last_name', $post_id) ?? '';
|
|
||||||
|
|
||||||
$full_name = $first_name . ' ' . $last_name;
|
$is_carhop_member = $_POST['acf']['field_691c8279b6458'];
|
||||||
|
$carhop_member_id = $_POST['acf']['field_691c831e94029'] ?? null;
|
||||||
|
|
||||||
if ($full_name && $full_name != '') {
|
$first_name = null;
|
||||||
$post_slug = sanitize_title($full_name);
|
$last_name = null;
|
||||||
wp_update_post(array(
|
|
||||||
'ID' => $post_id,
|
if (!$is_carhop_member) {
|
||||||
'post_title' => $full_name,
|
$first_name = get_field('first_name', $post_id);
|
||||||
'post_name' => $post_slug
|
$last_name = get_field('last_name', $post_id);
|
||||||
));
|
}
|
||||||
}
|
|
||||||
|
if (isset($is_carhop_member) && isset($carhop_member_id)) {
|
||||||
|
switch_to_blog(1);
|
||||||
|
$first_name = get_field('first_name', $carhop_member_id);
|
||||||
|
$last_name = get_field('last_name', $carhop_member_id);
|
||||||
|
$comity = get_field('comity', $carhop_member_id);
|
||||||
|
|
||||||
|
write_log($comity);
|
||||||
|
|
||||||
|
// $membre_carhop = get_post($carhop_member_id);
|
||||||
|
// write_log($_POST['acf']);
|
||||||
|
// $description = get_field('description', $carhop_member_id);
|
||||||
|
// $comity = get_field('comity', $carhop_member_id);
|
||||||
|
// $email = get_field('email', $carhop_member_id);
|
||||||
|
|
||||||
|
|
||||||
|
// write_log($first_name);
|
||||||
|
// write_log($last_name);
|
||||||
|
// write_log($description);
|
||||||
|
// write_log($email);
|
||||||
|
|
||||||
|
$display_name = $first_name . ' ' . $last_name;
|
||||||
|
|
||||||
|
restore_current_blog();
|
||||||
|
|
||||||
|
update_field('comity', $comity, $post_id);
|
||||||
|
}
|
||||||
|
$full_name = $first_name . ' ' . $last_name;
|
||||||
|
if (isset($first_name) && isset($last_name) && isset($full_name) && $full_name != '') {
|
||||||
|
$post_slug = sanitize_title($full_name);
|
||||||
|
wp_update_post(array(
|
||||||
|
'ID' => $post_id,
|
||||||
|
'post_title' => $full_name,
|
||||||
|
'post_name' => $post_slug
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
add_filter('acf/load_field/name=carhop_member', function ($field) {
|
||||||
|
|
||||||
|
$field['choices'] = [];
|
||||||
|
|
||||||
|
switch_to_blog(1);
|
||||||
|
$equipe_members = get_posts(array(
|
||||||
|
'post_type' => 'equipe',
|
||||||
|
'posts_per_page' => -1,
|
||||||
|
'orderby' => 'title',
|
||||||
|
'order' => 'ASC',
|
||||||
|
));
|
||||||
|
restore_current_blog();
|
||||||
|
|
||||||
|
foreach ($equipe_members as $equipe_member) {
|
||||||
|
$field['choices'][$equipe_member->ID] = $equipe_member->post_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $field;
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
||||||
.author-card {
|
|
||||||
@apply grid w-full border border-primary p-6 mb-12 items-center;
|
|
||||||
grid-template-columns: min-content 1fr;
|
|
||||||
gap: 1rem;
|
|
||||||
|
|
||||||
transition: all 0.3s ease-in-out;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
@apply translate-y-[-4px];
|
|
||||||
}
|
|
||||||
|
|
||||||
&__profile-picture {
|
|
||||||
@apply w-32 h-32 object-cover p-2 border border-primary;
|
|
||||||
|
|
||||||
img {
|
|
||||||
@apply w-full h-full object-cover;
|
|
||||||
filter: grayscale(100%);
|
|
||||||
}
|
|
||||||
&-placeholder {
|
|
||||||
@apply bg-carhop-green-100 flex items-center justify-center;
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
content: '';
|
|
||||||
@apply block w-6 h-6 filter-primary;
|
|
||||||
background-image: url('../resources/img/icons/icon-losange.svg');
|
|
||||||
background-size: contain;
|
|
||||||
background-repeat: no-repeat !important;
|
|
||||||
background-position: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--1n:before {
|
|
||||||
background-image: url('../resources/img/icons/icon-losange.svg');
|
|
||||||
}
|
|
||||||
&--2n:before {
|
|
||||||
background-image: url('../resources/img/icons/icon-rectangle-rotated.svg');
|
|
||||||
}
|
|
||||||
&--3n:before {
|
|
||||||
background-image: url('../resources/img/icons/icon-circle.svg');
|
|
||||||
}
|
|
||||||
&--4n:before {
|
|
||||||
background-image: url('../resources/img/icons/icon-rectangle-vertical.svg');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-placeholder {
|
|
||||||
@apply w-full h-full bg-carhop-green-100 relative;
|
|
||||||
|
|
||||||
/* &:after {
|
|
||||||
@apply content-[''] block w-6 h-6 bg-carhop-green-700 rounded-full absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2;
|
|
||||||
} */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__infos {
|
|
||||||
@apply w-full flex flex-col gap-y-2;
|
|
||||||
.author-card__name {
|
|
||||||
@apply text-2xl uppercase font-medium tracking-normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.author-card__articles-amount {
|
|
||||||
@apply text-primary font-normal flex items-center gap-2;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: '';
|
|
||||||
@apply block w-6 h-6 bg-no-repeat bg-center;
|
|
||||||
background-image: url('../resources/img/icons/icon-activites.svg');
|
|
||||||
background-size: contain;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__description {
|
|
||||||
@apply col-span-2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -8,6 +8,17 @@ $profilePictureUrl = $profilePicture['url'] ?? '';
|
||||||
$profilePictureAlt = $profilePicture['alt'] ?? '';
|
$profilePictureAlt = $profilePicture['alt'] ?? '';
|
||||||
$comity = get_field('comity', $author_id);
|
$comity = get_field('comity', $author_id);
|
||||||
$articlesAmount = get_author_articles_amount($author_id);
|
$articlesAmount = get_author_articles_amount($author_id);
|
||||||
|
|
||||||
|
|
||||||
|
$is_carhop_member = get_field('is_carhop_member', $ID);
|
||||||
|
$carhop_member_id = get_field('carhop_member', $ID);
|
||||||
|
|
||||||
|
if ($is_carhop_member && isset($carhop_member_id)) {
|
||||||
|
switch_to_blog(1);
|
||||||
|
$description = get_field('description', $carhop_member_id);
|
||||||
|
$comity = get_field('comity', $carhop_member_id);
|
||||||
|
restore_current_blog();
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -98,7 +109,7 @@ $articlesAmount = get_author_articles_amount($author_id);
|
||||||
'ID' => $latestArticle[0]->ID,
|
'ID' => $latestArticle[0]->ID,
|
||||||
'showCover' => true,
|
'showCover' => true,
|
||||||
));
|
));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,17 @@ $profilePictureUrl = $profilePicture['url'] ?? '';
|
||||||
$profilePictureAlt = $profilePicture['alt'] ?? '';
|
$profilePictureAlt = $profilePicture['alt'] ?? '';
|
||||||
$description = get_field('description', $ID);
|
$description = get_field('description', $ID);
|
||||||
|
|
||||||
|
$is_carhop_member = get_field('is_carhop_member', $ID);
|
||||||
|
$carhop_member_id = get_field('carhop_member', $ID);
|
||||||
|
|
||||||
|
if ($is_carhop_member && isset($carhop_member_id)) {
|
||||||
|
switch_to_blog(1);
|
||||||
|
$description = get_field('description', $carhop_member_id);
|
||||||
|
restore_current_blog();
|
||||||
|
}
|
||||||
|
|
||||||
|
write_log($is_carhop_member);
|
||||||
|
|
||||||
$totalArticles = count_user_articles($ID, 'articles');
|
$totalArticles = count_user_articles($ID, 'articles');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user