function slickgrid_filter_plugins in Slickgrid 6
Return all plugins matching the filters
Parameters
array $plugins:
array $filters :
1 call to slickgrid_filter_plugins()
- slickgrid_get_plugins in ./
slickgrid.module - Enter description here ...
File
- ./
slickgrid.module, line 755
Code
function slickgrid_filter_plugins($plugins, $filters) {
// Loop through all of the plugins
foreach ($plugins as $plugin_type => $plugin) {
// Loop through the plugins
foreach ($filters as $property => $value) {
// If the plugin has a property that doesn't match the filter...
if (is_array($plugin[$property]) && !in_array($value, $plugin[$property]) || is_string($plugin[$property]) && $plugin[$property] != $value) {
// Remove the plugin
unset($plugins[$plugin_type]);
// And move onto the next plugin
break;
}
}
}
return $plugins;
}