View Single Post
  #1 (permalink)  
Old 03-14-2008, 03:22 AM
ryanhellyer's Avatar
ryanhellyer ryanhellyer is offline
Super Moderator
 
Join Date: Dec 2007
Posts: 708
Default string inside a function?

I'm trying to manipulate WordPress's wp_list_pages function for my dropdown menu plugin.

The following code, will generate a complete list of pages in your WordPress install, minus page number 262
PHP Code:
<ul>
    <?php wp_list_pages('exclude=262' ); ?>
</ul>
I want to allow users of my plugin to remove pages from their list via the admin panel. To do this, I first considered creating a string which contains the page number they want to exclude (eg: 262) and inserting that into the function like so:
PHP Code:
<ul>
    <?php
    wp_list_pages
('exclude=$whatever' ); ?>
</ul>
However when I tried this, it simply ignored the string.

Any ideas on how to get around this problem? It is a feature many of my plugins users would like but I haven't yet figured out how to implement it.

Thanks
Reply With Quote