I already have a function where a user submits a form and creates a custom post…
<?php $postTitle = $_POST['post_title'];
$submit = $_POST['submit'];
if(isset($submit)){
global $user_ID;
$new_post = array(
'post_title' => $postTitle,
'post_content' => '',
'post_status' => 'publish',
'post_date' => date('Y-m-d H:i:s'),
'post_author' => '',
'post_type' => 'stuff',
'post_category' => array(0)
);
$post_id = wp_insert_post($new_post);
add_post_meta($post_id, 'times', '1');
}
I want to check if the custom-post title exists, then if it does NOT, to go ahead and create the post with a #1 in the meta field, and if it does exist, to simply add 1 to the meta field