Skip to content

Instantly share code, notes, and snippets.

@wpcrmsystem
Created December 19, 2017 22:35
Show Gist options
  • Save wpcrmsystem/aa25a7d1fee08217f9e2b244cef23304 to your computer and use it in GitHub Desktop.
Save wpcrmsystem/aa25a7d1fee08217f9e2b244cef23304 to your computer and use it in GitHub Desktop.
Programmatically Create an Organization
<?php
function wpcrmsystem_add_record(){
$fields = array(
'title' => 'Autobots',
'phone' => '555-555-5555',
'email' => 'ng@autobot.com',
'url' => 'http://autobot.com',
'address_1' => '123 Main St',
'address_2' => '#100',
'city' => 'Anytown',
'state' => 'AZ',
'postal' => '85858',
'country' => 'USA',
'additional' => 'This is some extra content.',
);
$custom_fields = array(
'Hours' => '9-5',
);
$categories = 'Client, Another Category';
$status = 'publish';
$author = '1';
$update = false;
$create = new WPCRM_System_Create;
$create->organizations( $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