Compare commits

..

3 Commits

2 changed files with 24 additions and 1 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;
@ -160,7 +165,7 @@ function metiers_patrimoine_filter_posts_declare_dropdowns()
$meta_key = 'mdp_status';
$values = get_posts([
'post_status' => array('publish', 'draft', 'pending', 'offline', 'trash'),
'post_status' => 'any',
'post_type' => 'artisans',
'posts_per_page' => -1,
'meta_key' => $meta_key,

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;
}
}
}
@ -117,6 +118,7 @@ body.post-type-artisans {
.subsubsub {
.all,
.publish,
.draft,
.pending,
.trash,
.offline {
@ -139,6 +141,22 @@ body.post-type-artisans {
}
}
}
.draft {
@apply border-neutral-400;
transition: all 0.6s;
a,
span {
@apply !text-neutral-400;
}
&:hover,
&:has(a[aria-current='page']) {
@apply bg-neutral-400;
a,
span {
@apply !text-white;
}
}
}
.offline {
@apply border-neutral-700;
transition: all 0.6s;