EDIT:
You need to get the variable from AJAX in you case you need to do:
function profile_view() {
$user_id = $_GET["user_id"]; // name of hidden input
$args = array(
'post_type' => 'listings',
'post_status' => 'publish',
'meta_query' => array(
array(
'key' => 'stm_car_user',
'value' => $user_id
)
)
);
...
Related Posts:
- ajax category filter
- Order by two meta keys
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- How to get any tag ID
- wp_query not searching with apostrophe
- meta_query not working as expected
- Error with function in functions.php?
- Loading two different AJAX requests on two different pages
- Getting the post terms ‘wp_get_post_terms’ per post when within the functions.php file
- Multiple meta_key ordering with pre_get_posts
- WordPress dynamic AJAX query
- Finding post ID dynamically on click
- Fetching $_POST from Page Template into functions.php
- Declare inline background image in functions.php
- I wan to process the following js to process the AJAX Request on my function to calculate author Total Post views
- Changing sort order for presentation by Jetpack infinite scroll
- Large AND OR query timing out
- Orderby listing issue
- Help ordering Post loop by two meta values
- Order ascending is ignored in meta query?
- Display most popular in the past two days
- WP_Query with different postmeta filter for each categories
- get posts by meta_key from inside key of post meta
- Help optimizing slow WP_Query with meta_query
- meta_value_num not ordering all items
- Slow WP_Query with ‘OR’ on meta_query
- Meta Queries – should nesting work after WP 4.1?
- New WP_Query calls Pre_get_posts filter twice
- Filter and Order by Multiple Custom Meta Values
- Meta Query relation “AND” then set array accordingly
- Current post in AJAX call is always zero
- Configuring a meta query with multiple post types that have the same relationship on a single page
- 2 weeks ago from meta query meta value
- WP_Query with meta_query dosen’t return results
- database query with more than a couple meta hangs and doesn’t complete
- How to filter a query by multiple meta keys and order by other meta keys
- Filter wordpress post categories with jquery/ajax and pagination?
- meta_compare not comparing whole integer
- Get posts by list of post IDs ordered by those IDs?
- Query posts with “non set” meta value
- how to access query string in wordpress?
- Make meta query treat meta_value as 1 or 0
- Query with meta_query and tax_query together not working properly
- Array as ‘key’ in WP_Query
- Ordering a mysql style datetime stamp with meta_query
- Ajax future single post query doesn’t work when NOT logged in
- how update data through ajax and jquery
- Merge two search functions for custom post type
- Is it possible to query a custom field where the value is between two fields?
- Meta Query doesn’t works as espected
- how would i change post->ID to work correctly when querying pages?
- Make a SQL query with wpdb in WordPress
- Filter posts by comparing custom meta value against postdate
- How to provide meta_key array to wp_query?
- Wp_query with 2 meta keys and array of meta values
- Advanced WP_Query with meta_query, orderby?
- meta_query: check if number exists
- how to use pre_gets_posts to exclude one queried ID from homepage loop
- Searching for meta_key returns 0 posts
- Event with multiple dates, display events chronologically
- meta_query fails to compare on values containing apostrophes
- Use Ajax To filter posts?
- meta queries do ‘either/or’ checks
- How to set up hierarchical relationships without using plugins / meta query
- WP Query ordering on a meta field for posts with a date in the future not ordering by datetime
- Is this meta query problematic?
- WP Query Meta Value – How To Identify Specific, Unique Values?
- get term id from term name
- Selecting posts with a given meta value for a meta key
- Order by meta_key doesn’t work
- Change AJAX filter from POST to GET for URL Parameters
- Check if searched number is within the post meta value
- Meta query compare for ID’s greater than specific ID
- Appending to existing WP_Query’s meta_query if exists
- Exclude authors IDs from WP_Query
- AJAX Breaking Offset Argument In WP Query
- Apply filters to main query instead of creating new one?
- Issues with search after added meta_query
- How to load a script code only in posts?
- Sort by presence of thumbnail
- Display posts with specific value first in query
- Get every post with value in meta key
- it’s possible make a WP_Query with math operations?
- Post not populating for custom post type based on category selection
- WP_Query offset is returning post from prevois loop
- Sorting search results with custom dropdown
- get_page meta query not working, maybe a bug?
- WP_Query: apply an SQL function to meta fileld value
- How to search for meta_query LIKE or tax_query LIKE and grab these posts on search results?
- How to create dynamic value in WP_Query meta_query
- How to use a dropdown to filter posts by custom field
- Is it possible to add relation between meta_query and tax_query?
- Get meta_value of a specific meta_key from all posts belonging to a specific custom type
- Custom query filter by ACF date custom field
- How do I fit WP_Query arguments into a function?
- Create a notification for post field
- Does WP_Query ‘responds’ badly to empty arguments?
- Query by date from custom field
- Retrieve data from wordpress db via input and put those result in dropdown