Compare commits
No commits in common. "d244a3a933210c0505212301fca23a76f3a63992" and "4b7051c69ff7c2fb28d0ac7f8c14b5c82eaa4884" have entirely different histories.
d244a3a933
...
4b7051c69f
|
|
@ -353,18 +353,3 @@ 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' => sanitize_text_field($_GET['mdpstatus']),
|
'value' => $_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' => sanitize_text_field($_GET['conseiller']),
|
'value' => $_GET['conseiller'],
|
||||||
'compare' => '='
|
'compare' => '='
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|
@ -328,6 +328,9 @@ 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');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ##########################################################
|
// ##########################################################
|
||||||
// ##########################################################
|
// ##########################################################
|
||||||
// ##########################################################
|
// ##########################################################
|
||||||
|
|
@ -337,7 +340,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");
|
||||||
|
|
@ -355,7 +358,7 @@ function filter_posts_by_custom_datas($query)
|
||||||
$query->set('meta_query', [
|
$query->set('meta_query', [
|
||||||
[
|
[
|
||||||
'key' => 'mdp_status',
|
'key' => 'mdp_status',
|
||||||
'value' => sanitize_text_field($_GET['mdpstatus']),
|
'value' => $_GET['mdpstatus'],
|
||||||
'compare' => '='
|
'compare' => '='
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user