/grid/loaders
This filter allows to add custom loaders to display when a grid is filtered.
Argument | Type | Description |
$loaders | array | Holds registered grid loaders |
[pastacode lang=”php” manual=”function%20prefix_register_grid_loaders(%20%24loaders%20)%20%7B%0A%0A%09%2F%2F%20’my_loader’%20corresponds%20to%20the%20loader%20slug.%20%0A%09%24loaders%5B’my_loader’%5D%20%3D%20%5B%20%0A%09%09’name’%20%3D%3E%20__(%20’Loading…’%2C%20’text-domain’%20)%2C%0A%09%09’html’%20%3D%3E%20’%3Cdiv%20class%3D%22loading-text%22%3E’%20.%20esc_html__(%20’Loading…’%2C%20’text-domain’%20)%20.%20’%3C%2Fdiv%3E’%2C%20%0A%09%09’css’%20%3D%3E%20’%40keyframes%20loading-animation%7B0%25%7Bopacity%3A1%7D50%25%7Bopacity%3A0%7D100%25%7Bopacity%3A1%7D%7D.my_loader%7Bdisplay%3Aflex%3Balign-items%3Acenter%3Bjustify-content%3Acenter%7D.loading-text%7Bfont-weight%3A600%3Bfont-size%3A14px%3Bbackground%3A0%200!important%3Banimation%3Aloading-animation%201s%20infinite%7D’%2C%20%0A%09%5D%3B%0A%09%0A%09return%20%24loaders%3B%0A%0A%7D%0A%0Aadd_filter(%20’wp_grid_builder%2Fgrid%2Floaders’%2C%20’prefix_register_grid_loaders’%2C%2010%2C%201%20)%3B” message=”” highlight=”” provider=”manual”/]