This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // delete_post_revisions will be call when the Cron is executed | |
| add_action( 'delete_post_revisions', 'delete_all_post_revisions' ); | |
| // This function will run once the 'delete_post_revisions' is called | |
| function delete_all_post_revisions() { | |
| $args = array( | |
| 'post_type' => 'post', | |
| 'posts_per_page' => -1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Make sure this event hasn't been scheduled | |
| if( !wp_next_scheduled( 'delete_post_revisions' ) ) { | |
| // Schedule the event | |
| wp_schedule_event( time(), 'daily', 'delete_post_revisions' ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="redeem-coupon"> | |
| <form id="ajax-coupon-redeem"> | |
| <p> | |
| <input type="text" name="coupon" id="coupon"> | |
| <input type="submit" name="redeem-coupon" value="Redeem Offer" /> | |
| </p> | |
| <p class="result"></p> | |
| </form><!-- #ajax-coupon-redeem --> | |
| </div><!-- .redeem-coupon --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'wp_ajax_spyr_coupon_redeem_handler', 'spyr_coupon_redeem_handler' ); | |
| add_action( 'wp_ajax_nopriv_spyr_coupon_redeem_handler', 'spyr_coupon_redeem_handler' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function spyr_coupon_redeem_handler() { | |
| // Get the value of the coupon code | |
| $code = $_REQUEST['coupon_code']; | |
| // Check coupon code to make sure is not empty | |
| if( empty( $code ) || !isset( $code ) ) { | |
| // Build our response | |
| $response = array( |