Option arrays merged the wrong way?
-
Hi!
I’ve been debugging an issue on my site where filters weren’t working (always showed all posts) and managed to track it down to line 174 of classes/Initialization.php, where the block’s options (
$value['attrs']
) are merged with the request’s ($attr
). Your code seems to merge the block’s options into the request’s option, when it would make more sense to be the other way around (i.e. the request’s options should overwrite the block’s).The fix for me was to swap the parameters of the array_merge function call. I have also found other instances of similar calls in your code, but have not investigated those as they do not effect my particular setup.
EDIT: This fix, however, breaks the “All” option in the filter, as that makes it display all categories, not just the ones set in the block’s settings.
I do not have much time to continue testing this as I am approaching a deadline, but I hope this is enough information to help you understand an fix the problem.
(WP v5.4.1, plugin v1.1.7, block Post Grid #1 with post type “post”, tax=category, filter=category)
- The topic ‘Option arrays merged the wrong way?’ is closed to new replies.