Skip Navigation

[Resolved] order applied to all views

This support ticket is created 4 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.
Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 0 reply, has 1 voice.

Last updated by garenM 4 years, 1 month ago.

Assisted by: Jamal.

Author
Posts
#2018275

hey i made a custom order in a toolset view but its apply in all views that i have in the site

function add_custom_fiels_to_view_query($query_args, $view_settings, $view_id ) {
if ( $view_id == 1251 ){

$meta_query = array();
$meta_query[] = array('key' => 'wpcf-single-image');
if ( !isset($query_args['meta_query']) ){
$query_args['meta_query'] = array();
}
$query_args['meta_query'] = array_merge($meta_query, $query_args['meta_query']);

return $query_args;
} else{
return;
}
}

there is something else that i have to do? can you advise?