Skip to content

Instantly share code, notes, and snippets.

@wycks
Last active December 26, 2015 17:09
Show Gist options
  • Save wycks/7185321 to your computer and use it in GitHub Desktop.
Save wycks/7185321 to your computer and use it in GitHub Desktop.
<?php
//get all ze hooks
$Directory = new RecursiveDirectoryIterator( 'WordPress\3.7' );
$Iterator = new RecursiveIteratorIterator( $Directory );
$regex = new RegexIterator( $Iterator, '/^.+\.php$/i', RecursiveRegexIterator::GET_MATCH );
foreach ( $regex as $filename=>$file ) {
$content = file_get_contents( $file[0] );
$ext = pathinfo( $filename, PATHINFO_BASENAME );
//get all
preg_match_all( "/apply_filters.*?;|do_action.*?;|add_action.*?;|apply_filters_ref_array.*?;|do_action_ref_array.*?;/", $content, $applyfilter );
foreach( $applyfilter as $filtermatch ) {
// do stuff
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment