Does anyone know how to get all the functions in the current plugin? Only those functions which it declared?
I know about function get_defined_functions()
and tried it, but this function gets list of all function, but I needed only in current plugin.
Maybe in WP there is the function which can get all functions in plugin?
Of course we can get the names of the function in the following way, but it is not the best way, because our plugin can include other files and I can't get their functions.
$filename = __FILE__;
$matches = array();
preg_match_all('/function\s+(\w*)\s*\(/', file_get_contents($filename), $matches);
$matches = $matches[1];