Skip to content

Instantly share code, notes, and snippets.

@klakegg
Last active December 19, 2015 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klakegg/5929836 to your computer and use it in GitHub Desktop.
Save klakegg/5929836 to your computer and use it in GitHub Desktop.
<?php
/**
* Implements hook_module_implements_alter().
*
* Make sure to call hooks with the same prefix as this hook after all other hooks.
*/
function MODULE_module_implements_alter(&$implementations, $hook) {
$prefix = array_shift(explode('_', __FUNCTION__));
$found = array();
foreach ($implementations as $key => $value) {
if (strpos($key, $prefix) !== FALSE) {
$found[$key] = $value;
unset($implementations[$key]);
}
}
$implementations = array_merge($implementations, $found);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment