Compare commits
3 Commits
4b7051c69f
...
d244a3a933
| Author | SHA1 | Date | |
|---|---|---|---|
| d244a3a933 | |||
| 2e1082e749 | |||
| ab5b6631de |
|
|
@ -353,3 +353,18 @@ function add_custom_taxonomy_menu_item()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
add_action('admin_menu', 'add_custom_taxonomy_menu_item');
|
add_action('admin_menu', 'add_custom_taxonomy_menu_item');
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------
|
||||||
|
Masquer le menu "Chantiers" pour les utilisateurs non autorisés
|
||||||
|
--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
function hide_chantiers_menu()
|
||||||
|
{
|
||||||
|
$current_user = wp_get_current_user();
|
||||||
|
$allowed_roles = array('administrator', 'editor');
|
||||||
|
if (current_user_can('editor')) return;
|
||||||
|
|
||||||
|
remove_menu_page('edit.php?post_type=chantiers');
|
||||||
|
}
|
||||||
|
add_action('admin_menu', 'hide_chantiers_menu', 999);
|
||||||
|
|
|
||||||
|
|
@ -307,7 +307,7 @@ function filter_posts_by_acf_conseiller($query)
|
||||||
$query->set('meta_query', [
|
$query->set('meta_query', [
|
||||||
[
|
[
|
||||||
'key' => 'mdp_status',
|
'key' => 'mdp_status',
|
||||||
'value' => $_GET['mdpstatus'],
|
'value' => sanitize_text_field($_GET['mdpstatus']),
|
||||||
'compare' => '='
|
'compare' => '='
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|
@ -318,7 +318,7 @@ function filter_posts_by_acf_conseiller($query)
|
||||||
$query->set('meta_query', [
|
$query->set('meta_query', [
|
||||||
[
|
[
|
||||||
'key' => 'conseiller',
|
'key' => 'conseiller',
|
||||||
'value' => $_GET['conseiller'],
|
'value' => sanitize_text_field($_GET['conseiller']),
|
||||||
'compare' => '='
|
'compare' => '='
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|
@ -328,9 +328,6 @@ function filter_posts_by_acf_conseiller($query)
|
||||||
add_action('pre_get_posts', 'filter_posts_by_acf_conseiller');
|
add_action('pre_get_posts', 'filter_posts_by_acf_conseiller');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ##########################################################
|
// ##########################################################
|
||||||
// ##########################################################
|
// ##########################################################
|
||||||
// ##########################################################
|
// ##########################################################
|
||||||
|
|
@ -340,7 +337,7 @@ function mytheme_filter_posts_declare_dropdowns()
|
||||||
{
|
{
|
||||||
// [.. Vericications de base]
|
// [.. Vericications de base]
|
||||||
|
|
||||||
// Les données sont correctement retournées au chargement initial de la page (lorsqu’aucun filtre n’est appliqué),
|
// Les données sont correctement retournées au chargement initial de la page (lorsqu'aucun filtre n'est appliqué),
|
||||||
// mais elles sont vides lorsque le filtre est activé.
|
// mais elles sont vides lorsque le filtre est activé.
|
||||||
$mdp_status_datas_object = get_field_object("mdp_status");
|
$mdp_status_datas_object = get_field_object("mdp_status");
|
||||||
$mdp_status_datas = acf_get_field("mdp_status");
|
$mdp_status_datas = acf_get_field("mdp_status");
|
||||||
|
|
@ -358,7 +355,7 @@ function filter_posts_by_custom_datas($query)
|
||||||
$query->set('meta_query', [
|
$query->set('meta_query', [
|
||||||
[
|
[
|
||||||
'key' => 'mdp_status',
|
'key' => 'mdp_status',
|
||||||
'value' => $_GET['mdpstatus'],
|
'value' => sanitize_text_field($_GET['mdpstatus']),
|
||||||
'compare' => '='
|
'compare' => '='
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user