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. :)

  • 1
    Don't load theme files directly, see this answer for an alternative. – Milo Jul 22 '15 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 Jul 26 '15 at 21:34
  • As Milo pointed out, you can find the answer [at this link][1]. :) [1]: wordpress.stackexchange.com/questions/126572/… – Hardeep Asrani Jul 26 '15 at 21:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.