Skip to content

Instantly share code, notes, and snippets.

@dancameron
Created October 8, 2019 17:51
Show Gist options
  • Save dancameron/14f0d0f491781b8d223320f86ffd211e to your computer and use it in GitHub Desktop.
Save dancameron/14f0d0f491781b8d223320f86ffd211e to your computer and use it in GitHub Desktop.
Modifying Column Titles
<?php // don't include this line in your functions.php, since it already starts with it.
function si_convert_perc_to_discount_column_label( $columns = array() ) {
if ( is_admin() ) {
return $columns;
}
$columns['rate']['label'] = 'Fee';
$columns['tax']['label'] = 'VAT';
$columns['total']['label'] = 'Total';
if ( ! is_admin() ) {
unset( $columns['qty'] );
}
return $columns;
}
add_filter( 'si_line_item_columns', 'si_convert_perc_to_discount_column_label' );
function si_change_strings( $translations, $text, $domain ) {
if ( 'sprout-invoices' === $domain ) {
// Change "Description"
if ( 'Task' === $text ) {
return 'Description';
}
// add more conditions, changing as many strings as you'd like
}
return $translations;
}
add_filter( 'gettext', 'si_change_strings', 10, 3 );
@dancameron
Copy link
Author

This snippet is a customization for Sprout Invoices. A customizable solution that provides a way for you to get paid via your WordPress site. For more information please don't hesitate to reach out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment