I have created an Option Page that holds several discount coupons for an e-shop. I obviously don’t want these coupons to be printed anywhere in the theme.
Every time a user inputs a coupon code, an AJAX function POSTs the code to check_coupon_handler.php. Inside this script, I would like to get all the Option Page coupons to check whether there is one that matches the user input.
To achieve this, should I query directly the WP database, or is there a way to do so through the ACF API?
Calling get_field from check_coupon_handler.php obviously results in an undefined function error. I tried requiring wp-blog-header.php as a start, but I’m not sure whether this path makes sense.
ACF PRO’s Flexible Content field allows you to create smaller pieces of UI and compose them into whole flexible patterns. In our latest article, we show how to use it to create swappable site sections and integrate it all in a theme.https://t.co/ZRocH8oJSp