Skip to content

Developers-Hooks & Filters

Posted on:September 23, 2022 at 03:24 PM

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

Page Section Filters

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');