Last active
August 12, 2017 16:02
-
-
Save hendcorp/68f246bbf760083bd639d356ca4babfd to your computer and use it in GitHub Desktop.
WC Vendors Simple Auction - Date Generator
This file contains 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 | |
//Start Date - Set default to todays date | |
update_post_meta( $post_id, '_auction_dates_from', stripslashes( date('Y-m-d H:i') ) ); | |
//End Date - conditional | |
if (isset($_POST['_auction_duration'])): | |
$aucdur = $_POST['_auction_duration'] + 1; | |
$duration = "+".$aucdur." day"; | |
update_post_meta( $post_id, '_auction_dates_to', stripslashes( date('Y-m-d H:i', strtotime($duration)) ) ); | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment