1

I have an API Request for weather and the account of this weather stuff has a limitation of requests per minute. In my theme I have the weather information twice on the same page. So if I would make a function of the request it would fire twice. I thought about a global variable, where I could save the request once and grap this variable where ever I want.

Is this a good idea? I read something about, that global variables aren't a good choice!? Is there an other solution?

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.