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
When retrieving related entities with WP_Query->query() by ID or set of IDs, the resulting entities will have the ID of the related entities set as the mb_origin property. This allows us to avoid having to query backwards for each entity. However, when returning the results, such as in a function e.g. get_answers_for_questions(), the consumer of such a function cannot know whether the entities were retrieved by mb-relationships, or in some other way, and therefore cannot rely on some generic mb_origin property.
It could be useful to be able to set a name for it. In my case, when I try to get Answer posts related to questions with the specified IDs, it would be useful if the Question ID of each Answer was under e.g. question_id. This could be as easy as changing the column alias name.
Also, if multiple Answers match each question ID, there will be more than one Answer in the result - each with a different mb_origin. It could be extremely useful to have the ability to have only unique Answers, but their e.g. question_ids parameter set to an array of IDs of related Questions.
The text was updated successfully, but these errors were encountered:
When retrieving related entities with
WP_Query->query()
by ID or set of IDs, the resulting entities will have the ID of the related entities set as themb_origin
property. This allows us to avoid having to query backwards for each entity. However, when returning the results, such as in a function e.g.get_answers_for_questions()
, the consumer of such a function cannot know whether the entities were retrieved bymb-relationships
, or in some other way, and therefore cannot rely on some genericmb_origin
property.It could be useful to be able to set a name for it. In my case, when I try to get Answer posts related to questions with the specified IDs, it would be useful if the Question ID of each Answer was under e.g.
question_id
. This could be as easy as changing the column alias name.Also, if multiple Answers match each question ID, there will be more than one Answer in the result - each with a different
mb_origin
. It could be extremely useful to have the ability to have only unique Answers, but their e.g.question_ids
parameter set to an array of IDs of related Questions.The text was updated successfully, but these errors were encountered: