Skip to content

Instantly share code, notes, and snippets.

@wpcrmsystem
Created December 19, 2017 23:05
Show Gist options
  • Save wpcrmsystem/8ddb037086a7d7a24fbb6c825ff4556b to your computer and use it in GitHub Desktop.
Save wpcrmsystem/8ddb037086a7d7a24fbb6c825ff4556b to your computer and use it in GitHub Desktop.
Programmatically create new WP-CRM System Tasks
<?php
function wpcrmsystem_add_record(){
$fields = array(
'title' => 'South America',
'org' => 'Autobot',
'contact' => 'Mathew Powers',
'project' => 'Conquer the world',
'assigned' => 'user@yourcrm.com',
'start_date' => '12/30/2017', // any date format will work (12/31/2017, 31 Dec 2017)
'due_date' => '12/31/2017', // any date format will work (12/31/2017, 31 Dec 2017)
'progress' => '25', // valid values are 0-100 skip counted by 5 (0,5,10,15,etc.)
'priority' => 'medium', // valid values are low, medium, or high
'status' => 'in-progress', // valid values are not-started, in-progress, complete, on-hold
'additional' => 'This is some extra content.',
);
$custom_fields = array(
'Task info' => 'More information',
);
$categories = 'Graphics';
$status = 'draft';
$author = '1';
$update = false;
$create = new WPCRM_System_Create;
$create->tasks( $fields, $custom_fields, $categories, $status, $author, $update );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment