Last active
December 26, 2015 17:09
-
-
Save wycks/7185321 to your computer and use it in GitHub Desktop.
WordPress Hook grabber for https://github.com/wycks/SublimeText-WordPress-Autocomplete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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