You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
would it be possible to expose the PostQuery to the QueryBuilder etc so we can get eg ->found_posts (and any similar data)
currently I have to run a separate WP_Query with my builder's $query->getParameters() just to get the info again but this means querying all the posts that presumably have already been queried
I'm not sure what the syntax for it would be though. I did see it is possible to add elements to the collection outside of the items array,. so maybe accessible that way?
$query = (newQueryBuilder)->wherePostType(["news","event"])->limit(3)->as(SocialPost::class);
// or $query = SocialPost::builder()->limit(3);$post_query = newPostQuery($query->getParameters(), SocialPost::class);
$posts = $post_query->get_posts();
dd(count($posts)." of ".$post_query->found_posts);
shows:
3 out of 10
is there anything that $query->get() will give me that $post_query->get_posts() won't? I guess some Collection functionality? I think I can just do an equivalent with this.
would it be possible to expose the
PostQuery
to theQueryBuilder
etc so we can get eg->found_posts
(and any similar data)currently I have to run a separate
WP_Query
with my builder's$query->getParameters()
just to get the info again but this means querying all the posts that presumably have already been queriedI'm not sure what the syntax for it would be though. I did see it is possible to add elements to the collection outside of the items array,. so maybe accessible that way?
currently I tack it on to the end of my collection from that
WP_Query
then call egthanks for any suggestions.
J
The text was updated successfully, but these errors were encountered: