Get Current Post ID in functions php, meta query filter

You need to simply pass your current page with your ajax request.

Put this property on your “body” tag to be able to get this with JS in the future.

<body page-id="<?php get_the_ID(); ?>">

Find it in your JS

var page_id = $('body').attr("page-id")

Pass it along with your other “data”:

var data = {
   action : "my_ajax_filter_search",
   project_type : project_type,
   page_id: page_id
}