passing aria current to offline status on filttre supérieurs (subsubsub)

This commit is contained in:
Antoine M 2025-04-03 09:54:38 +02:00
parent c021b17d9e
commit 8d39b80ab2

View File

@ -136,12 +136,15 @@ add_filter('views_edit-artisans', function ($views) {
));
if ($count > 0) {
$class = (isset($_GET['post_status']) && $_GET['post_status'] === $status) ? 'current' : '';
$is_current = (isset($_GET['post_status']) && $_GET['post_status'] === $status);
$class = $is_current ? 'current' : '';
$aria_current = $is_current ? ' aria-current="page"' : '';
$views[$status] = sprintf(
'<a href="edit.php?post_type=%s&post_status=%s" class="%s">%s <span class="count">(%d)</span></a>',
'<a href="edit.php?post_type=%s&post_status=%s" class="%s"%s>%s <span class="count">(%d)</span></a>',
$post_type,
$status,
$class,
$aria_current,
__('Hors ligne', 'metiers-patrimoine-theme'),
$count
);