Skip to content

Instantly share code, notes, and snippets.

@wpcrmsystem
Created December 19, 2017 22:50
Show Gist options
  • Save wpcrmsystem/c8aef84b0519f7d65a5cafa00404b159 to your computer and use it in GitHub Desktop.
Save wpcrmsystem/c8aef84b0519f7d65a5cafa00404b159 to your computer and use it in GitHub Desktop.
Programmatically Create Project
function wpcrmsystem_add_record(){
$fields = array(
'title' => 'Conquers the world',
'value' => '1000000', // no special characters ($, etc.)
'close_date' => '12/31/2017', // any date format will work (12/31/2017, 31 Dec 2017, etc.)
'status' => 'in-progress',
'progress' => '25', // valid values are 0-100 skip counted by 5 (0,5,10,15, etc.)
'org' => 'Autobot',
'contact' => 'Mathew Powers',
'assigned' => 'user@yourcrm.com',// this can be the email address of a WP-CRM System user account, or display name
'additional' => 'This is some extra content.',
);
$custom_fields = array(
'Project import' => 'More information',
);
$categories = 'Graphics';
$status = 'draft';
$author = '1';
$update = false;
$create = new WPCRM_System_Create;
$create->projects( $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