Hi I have an ajax search pro shortcode inserted in on a post page and I need to grab the post page id variable and insert it in the meta value below, is there a way to do this…. I assume this would be done via javascript code/variable but I cannot find the code for it. I have inserted the code I am working with. Everything filters nicely if I manually enter the post ID but I would like it to be the post variable. I tried global $post, get_query_object_id(), get_the_ID() but nothing works
function asp_query_args_change($args, $search_id) {
if($search_id == '4'){
$args['post_meta_filter'] = array(
array(
'key' => '_EventOrganizerID',
'value' => 41069, <------- <strong>This is the post page the shortcode is inserted on</strong>
'operator' => '='
),
);
}
return $args;
}