Skip to content

Instantly share code, notes, and snippets.

<?php
function wpcrmsystem_add_record(){
$fields = array(
'title' => 'South America',
'org' => 'Autobot',
'contact' => 'Mathew Powers',
'campaign' => 'Conquer the world',
'assigned' => 'user@yourcrm.com',
'probability' => '25',
'close_date' => '12/30/2017',
@wpcrmsystem
wpcrmsystem / functions.php
Created December 19, 2017 23:05
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)
@wpcrmsystem
wpcrmsystem / functions.php
Created December 19, 2017 22:50
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
@wpcrmsystem
wpcrmsystem / functions.php
Created December 19, 2017 22:35
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',
@wpcrmsystem
wpcrmsystem / functions.php
Created December 19, 2017 22:30
Programmatically Create WP-CRM System Contact
<?php
// This function should receive information from a third party data source such as a contact form, another plugin, or API.
function wpcrmsystem_add_record(){
$fields = array(
'prefix' => 'mr',
'first_name' => 'Nosecone',
'last_name' => 'Gasket',
'org' => 'Autobot',
'role' => 'Leader',
'url' => 'http://autobot.com',
@wpcrmsystem
wpcrmsystem / style.css
Created July 24, 2017 17:07
Stylesheet used for the invoice template
#wpcrm_system_invoice {
width: 60%;
margin-left: auto;
margin-right: auto;
border-collapse: collapse;
margin-top: 0.75em;
border: 2px solid #f5f5f5;
font-family: sans-serif;
}
#wpcrm_system_header_customer, #wpcrm_system_header_invoice {
function my_organization_fields($fields){
$organizationFields = array(
array(
'name' => 'organization-email',
'title' => WPCRM_EMAIL,
'description' => '',
'placeholder' => '',
'type' => 'email',
'scope' => array( 'wpcrm-organization' ),
'style' => 'wp-crm-first',
@wpcrmsystem
wpcrmsystem / functions.php
Created November 2, 2016 23:12
Remove default WP-CRM System fields
add_action( 'admin_init', 'wpcrm_system_remove_fields' );
function wpcrm_system_remove_fields(){
// remove fields in campaigns
remove_filter( 'wpcrm_system_fields', 'wpcrm_system_campaign_fields', 10);
// remove fields in contacts
remove_filter( 'wpcrm_system_fields', 'wpcrm_system_contact_fields', 10);
// remove fields in organizations
remove_filter( 'wpcrm_system_fields', 'wpcrm_system_organization_fields', 10);
// remove fields in opportunities
remove_filter( 'wpcrm_system_fields', 'wpcrm_system_opportunity_fields', 10);
@wpcrmsystem
wpcrmsystem / wp-crm-system.php
Created September 1, 2016 22:51
Edit Category Box on Dashboard
<?php
// Remove default dashboard categories box
add_action( 'wpcrm_system_custom_dashboard_boxes', 'remove_dashboard_categories', 1 );
function remove_dashboard_categories() {
remove_action( 'wpcrm_system_custom_dashboard_boxes', 'wpcrm_system_dashboard_categories_box', 8 );
}
// Replace with your own dashboard box
add_action( 'wpcrm_custom_dashboard_boxes', 'add_dashboard_categories', 3 );
function add_dashboard_categories() { ?>
@wpcrmsystem
wpcrmsystem / wp-crm-system.php
Created August 30, 2016 21:00
Add license key setting field
<?php
// Add license key settings field
function wpcrm_custom_license_field() {
//get current tab
global $wpcrm_active_tab;
if ($wpcrm_active_tab == 'licenses') {
//your license key field
}
}
add_action( 'wpcrm_system_license_key_field', 'wpcrm_custom_license_field' );