I am not sure how relevant this is,i am working with Java based web-application, so in some cases we need to define some properties which can be used in entire web application like
- Google API Key
- Any other such key value
We tend to define a property file with extension .properties and than JAVA API provide a way to read this file, all we need to pass key name to the API and it wil return the value.
While working with WordPress API, i need to have such use case where i want to define such properties so that i can read them where ever i need those values, i am aware that WordPress read data from its config file but not sure how.
This is what i am trying
- Define a file in my theme folder say customProperties
- Define some key value pairs inside the file
and than where i need them, all i need to pass the key and it should return me the value associated with it.
I am sure this can be done with the help of DB, but i am looking for file based approach.
One option which seems relevant to me is to define those in my theme’s function.php
file
any pointer for this?