Skip to content

Instantly share code, notes, and snippets.

@Redolance
Created June 13, 2018 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Redolance/1f840bf58ba25cd7645ae2b5f8b062a0 to your computer and use it in GitHub Desktop.
Save Redolance/1f840bf58ba25cd7645ae2b5f8b062a0 to your computer and use it in GitHub Desktop.
Create custom filed , or just update it if its already exist .
$deal_id = $_POST['deal_id'];
if ( get_post_meta($deal_id, 'redo_expired_votes', true) ){
$ex_votes = get_post_meta($deal_id, 'redo_expired_votes', true);
$ex_vote = $ex_votes + 1;
update_post_meta($deal_id,'redo_expired_votes', $ex_vote);
}else{
add_post_meta($deal_id, 'redo_expired_votes', '1', true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment