Tiled Galleries: Add new filter 'jetpack_gallery_attachments'#3249
Tiled Galleries: Add new filter 'jetpack_gallery_attachments'#3249webbistro wants to merge 2 commits intoAutomattic:masterfrom
Conversation
There was a problem hiding this comment.
Needs a docblock. @webbistro - Could you add this when you get a chance?
* Filters the XYZ.
*
* @module tiled-gallery
*
* @since 3.9.0
*
* @param (type) (description)
*/
There was a problem hiding this comment.
Somehow calling apply_filters here feels awkward to me. The get_attachments method disregards any incoming parameters, which is not how filters should work. What do you say we bring back the old code here and just filter the returned value in the get_attachments method? This way you will only need to change code in one place.
Thanks for contributing and please let me know if I can help with that.
There was a problem hiding this comment.
You are right. I was a bit in hurry... I also need to reconsider the whole approach, since I am thinking about adding similar filters to WP core. I need a day or two. Thanks!
|
I'm holding this PR until 3.9.1, please let us know if you have any plans to go forward with this PR. |
|
Closing until @webbistro updates with his rethought approach :) |
In short: let other plugins to override the query for attachments for Tiled Galleries gallery template.
See detailed explanation at https://wordpress.org/support/topic/tiled-galleries-4