This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Contact Capabilities | |
edit_wpcrm-contact | |
read_wpcrm-contact | |
delete_wpcrm-contact | |
edit_wpcrm-contacts | |
edit_others_wpcrm-contacts | |
publish_wpcrm-contacts | |
read_private_wpcrm-contacts | |
read_wpcrm-contact | |
delete_wpcrm-contacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$status //Returns 'not-paid' or 'paid' | |
$businessImage //Returns the URL to the image for your business set in WP-CRM System>Settings>Invoicing tab | |
$businessName //Returns the name of the business set in WP-CRM System>Settings>Invoicing tab | |
$businessAddress //Returns the address for the business set in WP-CRM System>Settings>Invoicing tab | |
$businessPhone //Returns the phone number for the business set in WP-CRM System>Settings>Invoicing tab | |
$businessEmail //Returns the email address for the business set in WP-CRM System>Settings>Invoicing tab | |
$businessURL //Returns the website URL for the business set in WP-CRM System>Settings>Invoicing tab | |
$numFields //Returns the number of line items for a specific invoice. Used to loop through each line. See for loop starting on line 124 of the default template. | |
for ( $x = 1; $x <= $numFields; $x++ ) { | |
$lineName[$x] //Returns the name of the product/service on a line item. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function add_pages_to_filter( $array ) { | |
$array[] = 'post-new.php?post_type=my-custom-post-type'; | |
return $array; | |
} | |
add_filter( 'nd_allowed_pages' , 'add_pages_to_filter' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* How are displayed in the dropdown menu on WP-CRM System Dashboard | |
-------------------------------------------------------------------*/ | |
add_filter( 'wpcrm_system_user_role_options', 'wpcrm_system_select_user_roles', 10 ); | |
//roles should be listed with a capability as the key and the name of the role as the value | |
//all roles with the capability listed in the key will have access to WP-CRM System | |
function wpcrm_system_select_user_roles( $array ){ | |
$array = array( | |
'manage_options' => __('Administrator', 'wp-crm-system'), | |
'edit_pages' => __('Editor', 'wp-crm-system'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Default User Roles | |
--------------------*/ | |
add_filter( 'wpcrm_system_default_user_roles', 'wpcrm_system_check_user_roles', 10 ); | |
function wpcrm_system_check_user_roles( $array ){ | |
$array = array( | |
'subscriber', | |
'contributor', | |
'author', | |
'editor', | |
'administrator' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Action hooks that add the default boxes. | |
-----------------------------------------*/ | |
add_action( 'wpcrm_system_custom_dashboard_boxes', 'wpcrm_system_dashboard_create_new_box', 1 ); | |
add_action( 'wpcrm_system_custom_dashboard_boxes', 'wpcrm_system_dashboard_extensions_box', 2 ); | |
add_action( 'wpcrm_system_custom_dashboard_boxes', 'wpcrm_system_dashboard_categories_box', 3 ); | |
add_action( 'wpcrm_system_custom_dashboard_boxes', 'wpcrm_system_dashboard_settings_box', 4 ); | |
add_action( 'wpcrm_system_custom_dashboard_boxes', 'wpcrm_system_dashboard_projects_box', 5 ); | |
add_action( 'wpcrm_system_custom_dashboard_boxes', 'wpcrm_system_dashboard_tasks_box', 6 ); | |
add_action( 'wpcrm_system_custom_dashboard_boxes', 'wpcrm_system_dashboard_opportunities_box', 7 ); | |
add_action( 'wpcrm_system_custom_dashboard_boxes', 'wpcrm_system_dashboard_campaigns_box', 8 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Add a new meta box with your own custom field. | |
------------------------------------------------*/ | |
// Add a custom meta box to Contact edit pages. | |
// For more information, see https://developer.wordpress.org/reference/functions/add_meta_box/ | |
function extend_wpcrm_system() { | |
add_meta_box( 'wpcrm_custom_meta', __( 'Custom Meta', 'wp-crm-system-extend' ), 'wpcrmCustomMeta', 'wpcrm-contact', 'side', 'low' ); | |
} | |
add_action( 'wpcrm_system_custom_meta_boxes', 'extend_wpcrm_system' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Default hooks that display on overview page | |
-----------------------------------------------*/ | |
add_action( 'wpcrm_system_overview_reports', 'wpcrm_system_opportunity_value_overview_report', 1 ); | |
add_action( 'wpcrm_system_overview_reports', 'wpcrm_system_projects_value_overview_report', 2 ); | |
add_action( 'wpcrm_system_overview_reports', 'wpcrm_system_overdue_tasks_overview_report', 3 ); | |
/* Reorder overview report lines | |
--------------------------------*/ | |
remove_action( 'wpcrm_system_overview_reports', 'wpcrm_system_opportunity_value_overview_report', 1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Add custom report tab and content | |
------------------------------------*/ | |
// Add custom report's tab | |
add_action( 'wpcrm_system_report_tab', 'wpcrm_system_custom_report_tab', 8 ); | |
function wpcrm_system_custom_report_tab() { | |
// Retrieve the active tab | |
global $wpcrm_reports_active_tab; | |
//Be sure 'my-tab-name' is the same in both places! ?> | |
<a class="nav-tab <?php echo $wpcrm_reports_active_tab == 'my-tab-name' ? 'nav-tab-active' : ''; ?>" href="?page=wpcrm-reports&tab=my-tab-name"><?php _e('My Tab Name', 'wp-crm-system'); ?></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add a tab to the dashboard page | |
function wpcrm_system_custom_setting_tab() { | |
//Get current dashboard tab name | |
global $wpcrm_active_tab; | |
//Be sure that 'my-tab-name' is the same in both places! ?> | |
<a class="nav-tab <?php echo $wpcrm_active_tab == 'my-tab-name' ? 'nav-tab-active' : ''; ?>" href="?page=wpcrm-settings&tab=my-tab-name"><?php _e('My Tab Name', 'wp-crm-system') ?></a> | |
<?php } | |
add_action( 'wpcrm_system_settings_tab', 'wpcrm_system_custom_setting_tab' ); |
OlderNewer