1
vote
2answers
35 views

When and Where is `global $post` Set and Available?

Usually when people think of the global $post object it's assumed that it's actually set whenever you enter The Loop. I started to play around with how early I could actually call global $post which ...
0
votes
1answer
100 views

How to avoid repeatedly use the new statement to instantiate a class? [closed]

I have a Class with a lot of variables. To get a variable, I have to write this line in each function: $x = new MY_Class(); I guess there has to be another way? I tried: function my_data(){ ...