Ready to get started?Download WordPress


How to Use Global Variable? (1 post)

  1. stevewilson
    Posted 2 years ago #

    I have the following at the top of functions.php:`<?php global $callername; ?>
    `I then have a function that sets $callername, and another that gets its current value. But whereas the 'set' function works (it printf's $callername after setting), the get function then reports null. Do I misunderstand how global works or have I placed it wrongly?

Topic Closed

This topic has been closed to new replies.

About this Topic