• Hi, I am developing my first plugin and have hit my first (semi)impassible road block and it involves the use of globals… I just don’t get it and could really need some help. Thanks a lot!

    $tdzWitCount = 1;

    add_filter(‘bloginfo’, ‘tdz_add_wit’, 10, 2);

    function tdz_add_wit($info, $show) {
    global $tdzWitCount;
    if (($show == ‘name’) && ($tdzWitCount == 1)) {
    $info = $info . ” ” . “now has wit.”;
    $tdzWitCount++;
    }
    return $info;
    }

    I also tried:

    add_filter(‘bloginfo’, ‘tdz_add_wit’, 10, 2);

    function tdz_add_wit($info, $show) {
    static $count = 1;
    if (($show == ‘name’) and ($count == 1)) {
    $info = $info . ” ” . “is infinitely resourceful.”;
    $count == ($count + 1);
    }
    return $info;
    }

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘I need help with globals’ is closed to new replies.