Skip to content

Instantly share code, notes, and snippets.

@wycks
Last active December 21, 2015 05:39
Show Gist options
  • Select an option

  • Save wycks/6258280 to your computer and use it in GitHub Desktop.

Select an option

Save wycks/6258280 to your computer and use it in GitHub Desktop.

Revisions

  1. wycks revised this gist Aug 17, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions wp-parse-functions.php
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,9 @@
    //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;
    $i = 0; //count them

    // set to user, we don't want internal functions
    foreach ($functions['user'] as $func) {
  2. wycks revised this gist Aug 17, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion wp-parse-functions.php
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    <?php

    //just load at the way WP does
    //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();
  3. wycks revised this gist Aug 17, 2013. 1 changed file with 13 additions and 13 deletions.
    26 changes: 13 additions & 13 deletions wp-parse-functions.php
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    <?php

    //just load at the way WP does
    //just load at the way WP does
    include dirname(__FILE__) . '/wp-blog-header.php';
    require_once(ABSPATH . 'wp-admin/includes/admin.php');
    $functions = get_defined_functions();
    @@ -10,20 +10,20 @@
    // set to user, we don't want internal functions
    foreach ($functions['user'] as $func) {

    $wordpressfunctions = new ReflectionFunction($func);
    $args = array();
    $i++;
    $wordpressfunctions = new ReflectionFunction($func);
    $args = array();
    $i++;

    foreach ( $wordpressfunctions->getParameters() as $param) {
    //ToDo additiona check here for array/string/etc
    $tmparg = '';
    $tmparg.= '$' . $param->getName();
    foreach ( $wordpressfunctions->getParameters() as $param) {
    //ToDo additiona check here for array/string/etc
    $tmparg = '';
    $tmparg.= '$' . $param->getName();

    $args[] = $tmparg;
    unset ($tmparg);
    }
    $args[] = $tmparg;
    unset ($tmparg);
    }

    echo $i . ' ' . $func . '(' . implode(', ', $args) . ')' . '<br>';
    echo $i . ' ' . $func . '(' . implode(', ', $args) . ')' . '<br>';
    }
    ?>
  4. wycks created this gist Aug 17, 2013.
    29 changes: 29 additions & 0 deletions wp-parse-functions.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    <?php

    //just load at 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;

    // 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>';
    }
    ?>