' . $output;
echo json_encode( array( 'status' => 0, 'html' => $output ) );
die();
endif;
//Function to get a list of .php files
function find_all_files( $dir )
{
$root = scandir( $dir );
foreach( $root as $value )
{
if( $value !== '.' && $value !== '..' )
{
if( is_file( "$dir/$value" ) && preg_match( '/\.php$/', $value ) )
$result[] = "$dir/$value";
if( is_dir( "$dir/$value" ) )
{
foreach( find_all_files("$dir/$value") as $value )
{
$result[] = $value;
}
}
}
}
return ( isset( $result ) ? $result : Array() );
}
//Convert a 2 dimensional array to a single dimension
function array_2d_to_1d( $input_array )
{
$output_array = array();
for ($i = 0; $i < count($input_array); $i++)
for ($j = 0; $j < count($input_array[$i]); $j++)
$output_array[] = $input_array[$i][$j];
return $output_array;
}
?>
WordPress Hooks Search Tool
WordPress Hooks Search Tool
This tool scans all the PHP files in a directory you specify and lists out the Actions (from do_action) and Filters (from apply_filters) defined in these files. To search all files and subdirectories leave the Search in field empty. You may also specify a keyword to search for in the hook name.