Check if Post Title exists, Insert post if doesn’t, Add Incremental # to Meta if does
This would need a query. So building on your code: <?php $postTitle = $_POST[‘post_title’]; $submit = $_POST[‘submit’]; if(isset($submit)){ global $user_ID, $wpdb; $query = $wpdb->prepare( ‘SELECT ID FROM ‘ . $wpdb->posts . ‘ WHERE post_title = %s AND post_type = \’stuff\”, $postTitle ); $wpdb->query( $query ); if ( $wpdb->num_rows ) { $post_id = $wpdb->get_var( $query ); … Read more