updating and refactoring
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
dab69b5ab9
commit
1a6b5f2366
|
|
@ -54,7 +54,7 @@ function custom_post_status()
|
||||||
'exclude_from_search' => false,
|
'exclude_from_search' => false,
|
||||||
'show_in_admin_all_list' => true,
|
'show_in_admin_all_list' => true,
|
||||||
'show_in_admin_status_list' => true,
|
'show_in_admin_status_list' => true,
|
||||||
'label_count' => _n_noop('Unread (%s)', 'Unread (%s)'),
|
'label_count' => _n_noop('Hors Ligne (%s)', 'Hors Ligne (%s)'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
add_action('init', 'custom_post_status');
|
add_action('init', 'custom_post_status');
|
||||||
|
|
@ -113,24 +113,15 @@ add_action('admin_footer-edit.php', function () {
|
||||||
$('#bulk-edit select[name="_status"] option[value="publish"]').text('En ligne');
|
$('#bulk-edit select[name="_status"] option[value="publish"]').text('En ligne');
|
||||||
$('#bulk-edit select[name="_status"] option[value="offline"]').text('Hors ligne');
|
$('#bulk-edit select[name="_status"] option[value="offline"]').text('Hors ligne');
|
||||||
$('#bulk-edit select[name="_status"] option[value="pending"], #bulk-edit select[name="_status"] option[value="draft"], #bulk-edit select[name="_status"] option[value="private"]').remove();
|
$('#bulk-edit select[name="_status"] option[value="pending"], #bulk-edit select[name="_status"] option[value="draft"], #bulk-edit select[name="_status"] option[value="private"]').remove();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------
|
||||||
|
AJOUTER LE STATUT 'OFFLINE' DANS LA LISTE DES FILTRES SUPÉRIEURS (SUBSUBSUB)
|
||||||
|
--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Ajouter un filtre pour afficher les posts avec le statut 'offline'
|
|
||||||
add_filter('views_edit-artisans', function ($views) {
|
add_filter('views_edit-artisans', function ($views) {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
|
|
@ -151,7 +142,7 @@ add_filter('views_edit-artisans', function ($views) {
|
||||||
$post_type,
|
$post_type,
|
||||||
$status,
|
$status,
|
||||||
$class,
|
$class,
|
||||||
__('Offline', 'metiers-patrimoine-theme'),
|
__('Hors ligne', 'metiers-patrimoine-theme'),
|
||||||
$count
|
$count
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -160,6 +151,24 @@ add_filter('views_edit-artisans', function ($views) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------
|
||||||
|
REMPLACER LES LABELS DES FILTRES DE LA LISTE DES ARTISANS (TOUT EN HAUT DANS LE SUBSUBSUB)
|
||||||
|
--------------------------------------------------------------------------------------------*/
|
||||||
|
add_filter('views_edit-artisans', function ($views) {
|
||||||
|
write_log($views);
|
||||||
|
if (isset($views['publish'])) {
|
||||||
|
$views['publish'] = str_replace('Publié', 'En ligne', $views['publish']);
|
||||||
|
}
|
||||||
|
if (isset($views['offline'])) {
|
||||||
|
$views['offline'] = str_replace('Unread ', 'Hors ligne', $views['offline']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $views;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Ajouter le statut personnalisé aux actions de groupe
|
// Ajouter le statut personnalisé aux actions de groupe
|
||||||
function add_custom_bulk_actions($actions)
|
function add_custom_bulk_actions($actions)
|
||||||
|
|
@ -283,7 +292,6 @@ function metiers_new_admin_menu_order($menu_order)
|
||||||
// traverse through the new positions and move
|
// traverse through the new positions and move
|
||||||
// the items if found in the original menu_positions
|
// the items if found in the original menu_positions
|
||||||
foreach ($new_positions as $value => $new_index) {
|
foreach ($new_positions as $value => $new_index) {
|
||||||
// write_log($value);
|
|
||||||
if ($current_index = array_search($value, $menu_order)) {
|
if ($current_index = array_search($value, $menu_order)) {
|
||||||
metiers_move_element($menu_order, $current_index, $new_index);
|
metiers_move_element($menu_order, $current_index, $new_index);
|
||||||
}
|
}
|
||||||
|
|
@ -386,8 +394,6 @@ function add_post_status_to_body_class($classes)
|
||||||
if ($post && isset($post->post_status)) {
|
if ($post && isset($post->post_status)) {
|
||||||
$post_status = $post->post_status;
|
$post_status = $post->post_status;
|
||||||
$classes .= ' post-status-' . $post_status;
|
$classes .= ' post-status-' . $post_status;
|
||||||
// $classes[] = 'post-status-' . $post_status; // Ajoute une classe pour le statut du post
|
|
||||||
write_log($post_status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $classes;
|
return $classes;
|
||||||
|
|
|
||||||
|
|
@ -253,6 +253,11 @@ function remove_rank_math_seo_column_for_artisans($columns)
|
||||||
// Appliquer le filtre uniquement pour le post type "artisans"
|
// Appliquer le filtre uniquement pour le post type "artisans"
|
||||||
add_filter('manage_artisans_posts_columns', 'remove_rank_math_seo_column_for_artisans', 20);
|
add_filter('manage_artisans_posts_columns', 'remove_rank_math_seo_column_for_artisans', 20);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
DÉCLARATION DES COLONNES CUSTOM DANS LA LISTE DES POSTS ARTISANS
|
DÉCLARATION DES COLONNES CUSTOM DANS LA LISTE DES POSTS ARTISANS
|
||||||
------------------------------------------------------------------------*/
|
------------------------------------------------------------------------*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user