Hey there,
I can't make elementor custom query to work for post__in attribute with Toolset for a CPT called company. I am passing the post ids as an array but the query just does not run. All of my other queries work except the ones with post__in. So it seems like elementor custom query is working fine. I wanted to check with you if you have seen a similar issue from other users and is this related to compatibility between Toolset and elementor.
I'm not familiar with Elementor's query API, but the code you shared looks reasonable.
The first thing I would do is check whether it can work, i.e. instead of the above logic simply pass a hard-coded list of post IDs (sensible ones that you know should give the expected results), e.g.
Does that work? If not then what you are aiming to do doesn't seem possible. Elementor should have more information.
If it does then it would seem that there is a flaw in your code logic that will require some debugging.
For each variable you create, try dumping it to the debug.log to see if it gives the expected results, and in particular make sure that $portfolio_ids_array actually contains the expected array of IDs, e.g.