Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    sorry but this is not available by default.

    I had to deal with the same problem and I solved it via database. It is enough just to run the script:

    UPDATE jfq4_em_events SET recurrence_id=0 WHERE recurrence_id>0
    UPDATE jfq4_postmeta SET meta_value=0 WHERE meta_key=”_recurrence_id” AND meta_value>0

    The script is based on the code of detach function.

    /**
    	 * Returns if this is an individual event and is not recurring or a recurrence
    	 * @return boolean
    	 */
    	function detach(){
    		global $wpdb;
    		if( $this->is_recurrence() && !$this->is_recurring() && $this->can_manage('edit_recurring_events','edit_others_recurring_events') ){
    			//remove recurrence id from post meta and index table
    			$url = $this->get_attach_url($this->recurrence_id);
    			$wpdb->update(EM_EVENTS_TABLE, array('recurrence_id'=>0), array('event_id' => $this->event_id));
    			update_post_meta($this->post_id, '_recurrence_id', 0);
    			$this->feedback_message = __('Event detached.','events-manager') . ' <a href="'.$url.'">'.__('Undo','events-manager').'</a>';
    			$this->recurrence_id = 0;
    			return true;
    		}
    		$this->add_error(__('Event could not be detached.','events-manager'));
    		return false;
    	}
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Detach all recurring events?’ is closed to new replies.