Created
September 1, 2016 22:51
-
-
Save wpcrmsystem/e5699b1662b2298daf2e6344d9040e13 to your computer and use it in GitHub Desktop.
Edit Category Box on Dashboard
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 | |
// 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() { ?> | |
<div class="wpcrm-dashboard"> | |
<h2><?php _e( 'Categories', 'wp-crm-system' ); ?></h2> | |
<?php | |
// Remove any categories from this array that you don't want to show up. | |
// Example, remove 'organization-type'=>__('Organization Categories','wp-crm-system'), to get rid of the Organization Category link. | |
$categories = array('organization-type'=>__('Organization Categories','wp-crm-system'),'contact-type'=>__('Contact Categories','wp-crm-system'),'opportunity-type'=>__('Opportunity Categories','wp-crm-system'),'project-type'=>__('Project Categories','wp-crm-system'),'task-type'=>__('Task Categories','wp-crm-system'),'campaign-type'=>__('Campaign Categories','wp-crm-system'));?> | |
<ul> | |
<?php foreach ($categories as $key => $value) { ?> | |
<li><a href="edit-tags.php?taxonomy=<?php echo $key; ?>"><?php echo $value; ?></a></li> | |
<?php } ?> | |
<?php if (defined('WPCRM_INVOICING')) { ?> | |
<li><a href="edit-tags.php?taxonomy=invoice-type"><?php _e('Invoice Categories','wp-crm-system'); ?></a></li> | |
<?php } ?> | |
</ul> | |
</div> | |
<?php } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment