I am not clear about something and need your kind help. I have a JSON file in the same theme and I want to open the json file to get the content. I know wp_remote_get is for remote request. What function will I use for same domain requests.
Thanks
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI am not clear about something and need your kind help. I have a JSON file in the same theme and I want to open the json file to get the content. I know wp_remote_get is for remote request. What function will I use for same domain requests.
Thanks
Depends if you're requesting from server side or front end.
In PHP you can use file_get_contents() function.
In jQuery, you can use the HTTP get.