Creating a custom column with Client data should be fairly simple, here is a code example for creating a Client Email column that will show your client’s email address saved in the Side Edit page for the [client.email] token.
You can simply save the snippet to the PHP section of the Custom Dashboard extension, and that is it.
If you are using the Client Reports extension:
add_filter( 'mainwp_sitestable_getcolumns', 'mycustom_mainwp_sitestable_getcolumns', 10, 1 );
function mycustom_mainwp_sitestable_getcolumns( $columns ) {
$columns['client_email'] = "Client Email";
return $columns;
}
add_filter( 'mainwp_sitestable_item', 'mycustom_mainwp_sitestable_item', 10, 1 );
function mycustom_mainwp_sitestable_item( $item ) {
$tokens = apply_filters( 'mainwp_client_report_get_site_tokens', false, $item['id'] );
if ( is_array( $tokens ) && isset( $tokens['[client.email]'] ) ) {
$item['client_email'] = $tokens['[client.email]'];
}
return $item;
}
If you are using the Pro Reports extension:
add_filter( 'mainwp_sitestable_getcolumns', 'mycustom_mainwp_sitestable_getcolumns', 10, 1 );
function mycustom_mainwp_sitestable_getcolumns( $columns ) {
$columns['client_email'] = "Client Email";
return $columns;
}
add_filter( 'mainwp_sitestable_item', 'mycustom_mainwp_sitestable_item', 10, 1 );
function mycustom_mainwp_sitestable_item( $item ) {
$tokens = apply_filters( 'mainwp_pro_reports_get_site_tokens', false, $item['id'] );
if ( is_array( $tokens ) && isset( $tokens['[client.email]'] ) ) {
$item['client_email'] = $tokens['[client.email]'];
}
return $item;
}