Добрый день.
Пытаюсь в файле функций вордпресса получить список заказов определённого пользователя, но получаю бред в $query
$query = new WP_Query(array(
'meta_query' => array(
array(
'key' => '_customer_user',
'value' => $current_user->ID
)
)
));
Получаю
WP_Query Object
(
[query] => Array
(
[meta_query] => Array
(
[0] => Array
(
[key] => _customer_user
[value] => 37
)
)
)
[query_vars] => Array
(
[meta_query] => Array
(
[0] => Array
(
[key] => _customer_user
[value] => 37
)
)
[error] =>
[m] =>
[p] => 0
[post_parent] =>
[subpost] =>
[subpost_id] =>
[attachment] =>
[attachment_id] => 0
[name] =>
[static] =>
[pagename] =>
[page_id] => 0
[second] =>
[minute] =>
[hour] =>
[day] => 0
[monthnum] => 0
[year] => 0
[w] => 0
[category_name] =>
[tag] =>
[cat] =>
[tag_id] =>
[author] =>
[author_name] =>
[feed] =>
[tb] =>
[paged] => 0
[comments_popup] =>
[meta_key] =>
[meta_value] =>
[preview] =>
[s] =>
[sentence] =>
[fields] =>
[menu_order] =>
[category__in] => Array
(
)
[category__not_in] => Array
(
)
[category__and] => Array
(
)
[post__in] => Array
(
)
[post__not_in] => Array
(
)
[tag__in] => Array
(
)
[tag__not_in] => Array
(
)
[tag__and] => Array
(
)
[tag_slug__in] => Array
(
)
[tag_slug__and] => Array
(
)
[post_parent__in] => Array
(
)
[post_parent__not_in] => Array
(
)
[author__in] => Array
(
)
[author__not_in] => Array
(
)
[ignore_sticky_posts] =>
[suppress_filters] =>
[cache_results] => 1
[update_post_term_cache] => 1
[update_post_meta_cache] => 1
[post_type] =>
[posts_per_page] => 15
[nopaging] =>
[comments_per_page] => 50
[no_found_rows] =>
[order] => DESC
)
[tax_query] => WP_Tax_Query Object
(
[queries] => Array
(
)
[relation] => AND
[table_aliases:protected] => Array
(
)
[queried_terms] => Array
(
)
[primary_table] => _posts
[primary_id_column] => ID
)
[meta_query] => WP_Meta_Query Object
(
[queries] => Array
(
[0] => Array
(
[key] => _customer_user
[value] => 37
)
[relation] => OR
)
[relation] => AND
[meta_table] => _postmeta
[meta_id_column] => post_id
[primary_table] => _posts
[primary_id_column] => ID
[table_aliases:protected] => Array
(
[0] => _postmeta
)
)
[date_query] =>
[request] => SELECT SQL_CALC_FOUND_ROWS _posts.ID FROM _posts INNER JOIN _postmeta ON ( _posts.ID = _postmeta.post_id ) WHERE 1=1 AND _posts.post_type = 'post' AND (_posts.post_status = 'publish' OR _posts.post_status = 'nal' OR _posts.post_author = 37 AND _posts.post_status = 'private') AND (
( _postmeta.meta_key = '_customer_user' AND CAST(_postmeta.meta_value AS CHAR) = '37' )
) GROUP BY _posts.ID ORDER BY _posts.post_date DESC LIMIT 0, 15
[posts] => Array
(
)
[post_count] => 0
[current_post] => -1
[in_the_loop] =>
[comment_count] => 0
[current_comment] => -1
[found_posts] => 0
[max_num_pages] => 0
[max_num_comment_pages] => 0
[is_single] =>
[is_preview] =>
[is_page] =>
[is_archive] =>
[is_date] =>
[is_year] =>
[is_month] =>
[is_day] =>
[is_time] =>
[is_author] =>
[is_category] =>
[is_tag] =>
[is_tax] =>
[is_search] =>
[is_feed] =>
[is_comment_feed] =>
[is_trackback] =>
[is_home] => 1
[is_404] =>
[is_comments_popup] =>
[is_paged] =>
[is_admin] =>
[is_attachment] =>
[is_singular] =>
[is_robots] =>
[is_posts_page] =>
[is_post_type_archive] =>
[query_vars_hash:WP_Query:private] => 6fc6d1bb5872d32f522b3632429fb0c0
[query_vars_changed:WP_Query:private] =>
[thumbnails_cached] =>
[stopwords:WP_Query:private] =>
)
Как мне получить хотя бы id записей?