Skip to content

Instantly share code, notes, and snippets.

@dancameron
Last active January 13, 2020 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dancameron/e200438fa79378df235e to your computer and use it in GitHub Desktop.
Save dancameron/e200438fa79378df235e to your computer and use it in GitHub Desktop.
Setting a new Line Item Default
<?php // don't include this line in your functions.php, since it already starts with it.
function _set_new_default_si_type( $types = array() ) {
unset( $types['service'] ); // remove the type you want to make a default
return array_merge( array( 'service' => __( 'Service', 'sprout-invoices' ) ), $types ); // add it back at the top of the list.
}
add_filter( 'si_line_item_types', '_set_new_default_si_type' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment