/grid/settings
This filter is called every time grid settings are queried before to render or refresh grid (when filering with facets).
It allows to dynamically modifies settings of a grid. It can be pretty useful to use the same grid on different pages/posts with different behaviours.
Argument | Type | Description |
$settings | array | Holds grid settings |
[pastacode lang=”php” manual=”function%20prefix_grid_settings(%20%24settings%20)%20%7B%0A%0A%09%09%2F%2F%20If%20it%20matches%20grid%20id%201%2C%20we%20change%20the%20grid%20type.%20%0A%09%09if%20(%201%20%3D%3D%3D%20%24settings%5B’id’%5D%20)%20%7B%0A%09%09%09%24settings%5B’type’%5D%20%3D%20’masonry’%3B%0A%09%09%7D%20%0A%0A%09%09return%20%24settings%3B%0A%0A%09%7D%09%0A%0Aadd_filter(%20’wp_grid_builder%2Fgrid%2Fsettings’%2C%20’prefix_grid_settings’%2C%2010%2C%201%20)%3B” message=”” highlight=”” provider=”manual”/]