Compare commits

..

No commits in common. "3334906e1b682ec56c0894e509095a76b33ed0c7" and "295684c65491d374b44e3e4fff5e1d99bb42e2f8" have entirely different histories.

View File

@ -148,6 +148,9 @@ function metiers_patrimoine_filter_posts_declare_dropdowns()
{
global $typenow;
global $wp_meta_boxes;
// global $pagenow;
// write_log($wp_meta_boxes);
$post_type = (isset($_GET['post_type'])) ? $_GET['post_type'] : 'post';
if ($post_type !== 'artisans') return;
@ -219,7 +222,7 @@ function metiers_patrimoine_filter_posts_declare_dropdowns()
<?php
$is_current = isset($_GET['conseiller']) ? $_GET['conseiller'] : '';
foreach ($conseillers as $index => $conseiller) {
if ($conseiller->ID == 1 || $conseiller->ID == 9) continue; // Escaping DeliAdmin and Conseiller accounts
printf(
'<option value="%s"%s>%s</option>',
$conseiller->ID,
@ -227,11 +230,6 @@ function metiers_patrimoine_filter_posts_declare_dropdowns()
$conseiller->display_name
);
}
printf(
'<option value="non_attribue"%s>%s</option>',
$is_current == 'non_attribue' ? ' selected="selected"' : '',
'— Non attribué —'
);
?>
</select>
<select name="mdpstatus">
@ -284,24 +282,13 @@ function filter_posts_by_acf_conseiller($query)
// FILTRE CONSEILLER
if (!empty($_GET['conseiller'])) {
if ($_GET['conseiller'] == 'non_attribue') {
$query->set('meta_query', [
[
'key' => 'conseiller',
'value' => '',
'compare' => '='
]
]);
} else {
$query->set('meta_query', [
[
'key' => 'conseiller',
'value' => sanitize_text_field($_GET['conseiller']),
'compare' => '='
]
]);
}
$query->set('meta_query', [
[
'key' => 'conseiller',
'value' => sanitize_text_field($_GET['conseiller']),
'compare' => '='
]
]);
}
}