Support » Everything else WordPress » Nested php function help!

  • Resolved whatachamp


    A little nested php question:
    I want to retrieve wordpress bookmarks with a certain category:
    <?php wp_list_bookmarks('title_li=&category_name=CUSTOMFIELD-ISSUE'); ?>
    and this category will be set on posts with the custom field ‘issue’:

    global $wp_query;
    $postid = $wp_query->post->ID;
    echo get_post_meta($postid, 'issue', true);

    How do I merge these two functions? My php-writing needs work, I know ;O)

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you are using PHP 5.3 you can get more Javacript-like behaviour with an anonymous function:

    function outer() {
        $inner=function() {
            echo "test\n";
    inner(); //PHP Fatal error:  Call to undefined function inner()
    $inner(); //PHP Fatal error:  Function name must be a string



    Not sure I understand your reply Apsira. Anyway, I got there in the end, here is the code I used for any one who’s interested:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Moderator Ipstenu (Mika Epstein)


    Lead Plugin Wrangler

    I think Apsira is spamming, but I just can’t tell.

    Can you post the code on pastebin? 🙂

    Yeah I think Aspira was spamming too.
    My code is in the pastebin:
    Thanks Ipstenu

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Nested php function help!’ is closed to new replies.