<?php
global $czpf_plugin;

function send_error_die($msg){
	die(json_encode(array('R'=>'ERR','MSG'=>$msg)));
}

if(!is_user_logged_in()){
	send_error_die('You are not logged in.');
}

if(empty($_REQUEST['tmp_post']) || !is_numeric($_REQUEST['tmp_post'])){
	send_error_die('Error contact support');
}

if(empty($_REQUEST['tmp_user_id']) || !is_numeric($_REQUEST['tmp_user_id'])){
	send_error_die('Error contact support');
}

add_action( 'init', 'create_post_typess' );	

function create_post_typess(){
    global $czpf_plugin,$wpdb,$wp_version;
    
   $wpdb->delete( $wpdb->prefix.'rhc_groups_teams', array('postID' => $_REQUEST['tmp_post'],'userID' => $_REQUEST['tmp_user_id']) );

   die(json_encode(array('R'=>'OK')));
}
?>