Skip to content

Instantly share code, notes, and snippets.

@wycks
Last active December 21, 2015 05:39
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 wycks/6258280 to your computer and use it in GitHub Desktop.
Save wycks/6258280 to your computer and use it in GitHub Desktop.
Parse all WP functions
<?php
//just load it the way WP does
include dirname(__FILE__) . '/wp-blog-header.php';
require_once(ABSPATH . 'wp-admin/includes/admin.php');
$functions = get_defined_functions();
$i = 0; //count them
// set to user, we don't want internal functions
foreach ($functions['user'] as $func) {
$wordpressfunctions = new ReflectionFunction($func);
$args = array();
$i++;
foreach ( $wordpressfunctions->getParameters() as $param) {
//ToDo additiona check here for array/string/etc
$tmparg = '';
$tmparg.= '$' . $param->getName();
$args[] = $tmparg;
unset ($tmparg);
}
echo $i . ' ' . $func . '(' . implode(', ', $args) . ')' . '<br>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment