REFACTOR Deleting duplicate code for parse query
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
3334906e1b
commit
44ed1be6d3
|
|
@ -327,23 +327,6 @@ function mytheme_filter_posts_declare_dropdowns()
|
||||||
|
|
||||||
add_action('restrict_manage_posts', 'mytheme_filter_posts_declare_dropdowns');
|
add_action('restrict_manage_posts', 'mytheme_filter_posts_declare_dropdowns');
|
||||||
|
|
||||||
function filter_posts_by_custom_datas($query)
|
|
||||||
{
|
|
||||||
// [.. Vericications de base]
|
|
||||||
|
|
||||||
if (!empty($_GET['mdpstatus'])) {
|
|
||||||
$query->set('meta_query', [
|
|
||||||
[
|
|
||||||
'key' => 'mdp_status',
|
|
||||||
'value' => sanitize_text_field($_GET['mdpstatus']),
|
|
||||||
'compare' => '='
|
|
||||||
]
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
add_action('pre_get_posts', 'filter_posts_by_custom_datas');
|
|
||||||
|
|
||||||
|
|
||||||
// **** FILTRAGE DES POSTS QUAND LA QUERY DE FILTER EST ENVOYEE
|
// **** FILTRAGE DES POSTS QUAND LA QUERY DE FILTER EST ENVOYEE
|
||||||
function metiers_patrimoine_filter_post_by_metiers_query($query)
|
function metiers_patrimoine_filter_post_by_metiers_query($query)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user