I'm working on a theme for a company and they don't want the users to touch the code at all. So as I love, they asked me to use Customizer API.
Now, there's a PHP file in the theme which we don't call anyone but on a MailChimp form, via AJAX. So basically, this PHP file is inside /inc/helper/mailchimp.php file but only gets called by an AJAX script.
So is there any way to render Customizer value inside the form? And the value will MailChimp API key so we don't want this to appear anywhere in the source code.
Anyone knows a way to do this? I have completed the entire theme and I just need to finish this. :)
I'm working on a theme for a company and they don't want the users to touch the code at all. So as I love, they asked me to use Customizer API.
Now, there's a PHP file in the theme which we don't call anyone but on a MailChimp form, via AJAX. So basically, this PHP file is inside /inc/helper/mailchimp.php file but only gets called by an AJAX script.
So is there any way to render Customizer value inside the form? And the value will MailChimp API key so we don't want this to appear anywhere in the source code.
Anyone knows a way to do this? I have completed the entire theme and I just need to finish this. :)
Share Improve this question asked Jul 22, 2015 at 19:19 Hardeep AsraniHardeep Asrani 6922 gold badges10 silver badges24 bronze badges 3- 1 Don't load theme files directly, see this answer for an alternative. – Milo Commented Jul 22, 2015 at 20:32
- Thanks, it worked! For those who try, if it doesn't work then navigate to Settings > Permalinks, and click on "Save" button, and then try again. Thanks again. :) – Hardeep Asrani Commented Jul 26, 2015 at 21:34
- As Milo pointed out, you can find the answer [at this link][1]. :) [1]: wordpress.stackexchange/questions/126572/… – Hardeep Asrani Commented Jul 26, 2015 at 21:35
1 Answer
Reset to default 0Coming back to this thread after five years as it's still wasn't marked as answered. Milo in the comments pointed out the answer: Trying to avoid including wp-load.php