FEAT added 'state' column to artisans list

This commit is contained in:
Antoine M 2025-04-07 16:16:41 +02:00
parent 2cdf0fa7f5
commit a7266db51a
2 changed files with 6 additions and 0 deletions

View File

@ -44,6 +44,7 @@ function metiers_patrimoine_artisans_add_acf_posts_columns($columns)
'metiers' => 'Métiers',
'elements' => 'Éléments du bâtiment',
'conseiller' => 'Conseiller',
'state' => 'État',
'mdpstatus' => 'Statut de travail',
'lastmodified' => 'Dernière modification',
'onlinedate' => 'Mise en ligne'
@ -71,6 +72,10 @@ function metiers_patrimoine_artisans_handle_posts_custom_columns($column)
echo $conseillerDatas->display_name;
}
if ($column == 'state') {
$status = get_post_status($post_id);
echo '<div class="status-state status-state--' . $status . '">' . translate_wordpress_online_statuses($status) . '</div>';
}
if ($column == 'mdpstatus') {
// $status = get_field('mdp_status', $post_id);
// if (!$status || !isset($status['label'])) return;

View File

@ -77,6 +77,7 @@ body.post-type-artisans {
.post-state {
@apply px-3 py-1 rounded-2xl font-medium text-xs border border-solid inline-block w-fit;
@apply hidden;
}
}
}