Hooks and filters

Before processing all the columns’ options and settings, premium members can override the columns with the wcpl_options filter.

If you look through the file /lib/Wpcl_Options.php, you will find the various defaults.

You will need to first create your own function and then hook it to the wpcl_options filter.

Let’s say you wanted to replace a column’s default display name

function kokomo_replace_billing_first_name_column_title( $columns ) {
$columns['wpcl_billing_first_name']['column_pretty_name'] = 'First Name of Awesome Customer';
return $columns;
add_filter( 'wpcl_options', 'kokomo_replace_billing_first_name_column_title', 10, 1 );

You can also replace the default options, the defaults for shortcodes and, even, the functions used to display the values in the tables through the wpcl_options hook.

Keep in mind that there are also other hooks that can be useful to your needs. For instance, there’s a filter for each formatter function with a name like 'wpcl_data_formatter/{column-slug}' for instance, you can change how the values comes out for the « Product ID » column by hooking into 'wpcl_data_formatter/product_id' .

Powered by BetterDocs