Skip to content

Instantly share code, notes, and snippets.

@wpcrmsystem
Created August 30, 2016 20:28
Show Gist options
  • Save wpcrmsystem/935038fdf43fac0a8c23bec510c3d37a to your computer and use it in GitHub Desktop.
Save wpcrmsystem/935038fdf43fac0a8c23bec510c3d37a to your computer and use it in GitHub Desktop.
Modify overview report tab
<?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 );
remove_action( 'wpcrm_system_overview_reports', 'wpcrm_system_projects_value_overview_report', 2 );
remove_action( 'wpcrm_system_overview_reports', 'wpcrm_system_overdue_tasks_overview_report', 3 );
add_action( 'wpcrm_system_overview_reports', 'wpcrm_system_opportunity_value_overview_report', 3 );
add_action( 'wpcrm_system_overview_reports', 'wpcrm_system_projects_value_overview_report', 1 );
add_action( 'wpcrm_system_overview_reports', 'wpcrm_system_overdue_tasks_overview_report', 2 );
/* Remove the opportunity value line from the overview report tab
------------------------------------------------------------------*/
add_action( 'wpcrm_system_overview_reports', 'remove_opportunity_value_overview', 1 );
function remove_opportunity_value_overview() {
remove_action( 'wpcrm_system_overview_reports', 'wpcrm_system_opportunity_value_overview_report', 1 );
}
/* Add new line(s) to overview report page
-------------------------------------------*/
add_action( 'wpcrm_system_overview_reports', 'my_overview_report' );
function my_overview_report() { ?>
<tr>
<td>
<strong>Title of line</strong>
</td>
<td>
Line value
</td>
</tr>
<?php }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment