We include several custom filters that will allow you to modify the output on the front end without ever modifying the plugin itself. If you are not familiar with WordPress filters and what they are, more information about filters can be found on the WordPress Codex.
The Custom Filter Hooks are as follows:
Specific Page Content Filters
wcp_all_leads_filter
- The Home page content (all contacts)wcp_events_filter
- The Calendar viewwcp_logging_filter
- The Logging Pagewcp_stats_filter
- The Statistics Pagewcp_ie_filter
- The Import and Export Pagewcp_individual_filter
- The Individual View Pagewcp_sst_fields_filter
- The Source Types and Status Pagewcp_edit_fields_filter
- The Edit Fields Pagewcp_front_sort_filter
- The Front Page Sorting Pagewcp_leads_filter
- The Front Page Leads Array, containing all lead fields output on the front page
Page Section Filters
wcp_head_section_filter
- Head Section and Side menuwcp_menu_links_filter
- Side menu contentswcp_bottom_section_filter
- Bottom of page content (footer)
What this means to you is as a developer is that you can modify the output of any of these pages and sections before it’s output by creating your own functions to customize what’s displayed – and when there is a plugin update, you’ll still have your modifications because they won’t be in the plugin!
For theme developers and those who just want to make customizations you can add these functions right in your theme’s functions.php file (or anywhere else that makes sense). Below are a couple of very simple examples to get you started in your own customizations.
<?php
/* Simply adding a header to the head output right after it */
function modify_wcp_head( $html ) {
return $html . '<h2>Test Adding to Head section</h2>';
}
add_filter( 'wcp_head_section_filter', 'modify_wcp_head');
/* Add another link, or something else to the side menu */
function modify_menu_links( $html ) {
return $html . '<li class="eventslink"><a href="#">New Link at the bottom <i class="wcp-md md-event-available"></i></a></li>';
}
add_filter( 'wcp_menu_links_filter', 'modify_menu_links');
/* Add your own content before the output on the default front page view */
function modify_all_leads( $html ) {
return '<p>Hi There</p>' . $html;
}
add_filter( 'wcp_all_leads_filter', 'modify_all_leads');