boonebgorges / buddypress-docs

GNU General Public License v3.0
106 stars 44 forks source link

Use `WP_Query` when fetching doc attachments. #646

Closed boonebgorges closed 5 years ago

boonebgorges commented 5 years ago

Plugins that filter parts of WP_Query to modify results - such as WPML - are stymied by the fact that we use get_posts() (with suppress_filters=true) instead of a direct WP_Query.

We could switch to using WP_Query, as in this PR. It's likely to have side effects. IMO it seems like the unwanted side effects of using WP_Query are fewer (and easier to predict, and easier to fix) than the side effects of not doing so. But @dcavins , would love your second opinion.

dcavins commented 5 years ago

Using WP_Query is a good change, I think, and fixes the issue of repeated attachments with WMPL in my test environment, too. Thanks!