title: Wordpress - Safest method to define global variables
body: <p>I don't know if "global" is the right word, but what I have to do is: define a variable that I can use in many parts of the template.</p>
  
  <p>Example: I have to define a variable that contains the ID of a static page</p>
  
  <pre><code>$page_id = 34
  </code></pre>
  
  <p>and I have to use it in different template parts, with functions like </p>
  
  <pre><code>get_page_link($page_id)
  </code></pre>
  
  <p>I found many way to do it (PHP define(), in function.php, global, ...) but I ask what is <strong>the most secure</strong>, in your opinion.</p>