List of all available WP functions

The easiest way to create a list of all the PHP functions Wordpress makes available, IMHO, is to do the following three (pretty easy) steps:


**UPDATE: While the following steps should still work fine, I decided to just write a Wordpress plugin that you can install directly from your WP site (just like you would any other plugin). Just go to the Add new plugins page and search for WP Function Reference and it should be at/towards the top of the page.**


Anyway... Now I forgot wh-- OH yeah: ...the following three (pretty easy) steps:
  1. Install/activate a plugin that allows you to write PHP code directly into your site, like PHP Code Widget
  2. On the widgets page of your site, find the draggable thing labeled PHP Code and drag it over to the sidebar
  3. Copy/paste the following code into the empty PHP Code box that just expanded itself and then click Save. That's all.
    <?php
    function show_me_the_available_functions() {
    $x = get_defined_functions();
      foreach ($x[user] as $y) {
      print "$y" . "<br/>";
      }
    }
    show_me_the_available_functions();
    ?>

Now go Visit the site.
Note: Although the above code is pretty simple, the output is kind of "not pretty" -- if you want that list to only show up for site admins, etc., use this code instead (which also looks nicer):

<?php
function show_me_the_available_functions() {
if (is_admin() || current_user_can('manage_options')) {
$x = get_defined_functions();
  echo '<ul>Available WP Functions:';
  foreach ($x[user] as $y) {
    echo '<li>' . $y . '()</li>';
  }
  echo '</ul>';
 }
}
show_me_the_available_functions();
?>

**When you look at the list, notice which function is (now) on the very bottom. :)


Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.