Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🍻Cheersing

Dan Cameron dancameron

💭
🍻Cheersing
View GitHub Profile
@dancameron
dancameron / functions.php
Created Feb 4, 2020
Square CSS for Sprout Invoices
View functions.php
<?php // don't include this line in your functions.php, since it already starts with it.
function _custom_si_pdf_service_scripts() {
ob_start(); ?>
<style type="text/css">
.sq-input {
height: 2em;
padding: .1em;
View functions.php
<?php // don't include this line in your functions.php, since it already starts with it.
function _custom_si_pdf_service_scripts( $old_scripts_and_styles ) {
$scripts_and_styles = $old_scripts_and_styles; // remove this line if you don't want to remove the default styling and scripts
ob_start(); // place your custom styles and javascript below ?>
<style type="text/css">
@dancameron
dancameron / functions.php
Created Jan 14, 2020
Slate Compatibility with Client VAT
View functions.php
<?php // don't include this line in your functions.php, since it already starts with it.
remove_action( 'si_document_vcards', array( 'Woo_Tools', 'add_vat_number_to_doc' ) );
remove_action( 'si_document_client_addy', array( 'SI_Hearts_EU', 'maybe_add_vat' ) );
function add_vat_below_address( $address ) {
ob_start();
SI_Hearts_EU::maybe_add_vat();
$vat .= ob_get_clean();
@dancameron
dancameron / functions.php
Created Jan 14, 2020
Remove VAT added by Woocommerce
View functions.php
<?php // don't include this line in your functions.php, since it already starts with it.
remove_action( 'si_document_vcards', array( 'Woo_Tools', 'add_vat_number_to_doc' ) );
View functions.php
<?php // don't include this line in your functions.php, since it already starts with it.
function fee_line_item_types( $types = array() ) {
$types = array(
'task' => __( 'Task', 'sprout-invoices' ),
'service' => __( 'Service', 'sprout-invoices' ),
'product' => __( 'Product', 'sprout-invoices' ),
'fee' => __( 'Fees', 'sprout-invoices' ),
);
@dancameron
dancameron / functions.php
Created Jan 6, 2020
Error Logging for Help Scout Desk Troubleshooting
View functions.php
<?php // don't include this in your functions.php, since the start of the file should already have it
function _hsd_api_log( $data, $endpoint ) {
error_log( '************* HSD API LOG *************' );
error_log( 'data' . print_r( $data, true ) );
error_log( 'endpoint' . print_r( $endpoint, true ) );
error_log( '************* HSD API LOG END *************' );
}
add_filter( 'hsd_v2_api_request_params', '_hsd_api_log', 10, 2 );
add_filter( 'hsd_v2_api_request', '_hsd_api_log', 10, 2 );
@dancameron
dancameron / functions.php
Created Jan 2, 2020
Set Default Min Payment Amount Due
View functions.php
<?php // don't include this line in your functions.php, since it already starts with it.
function _change_status_of_invoice_submission( SI_Invoice $invoice ) {
update_post_meta( $invoice->get_id(), '_si_client_set_payment', 1 );
}
add_action( 'si_gravity_forms_integration_invoice_created', '_change_status_of_invoice_submission' );
@dancameron
dancameron / functions.php
Created Dec 13, 2019
Remove Duplicate Column Headers
View functions.php
<?php // don't include this line in your functions.php, since it already starts with it.
add_filter( 'si_show_all_line_item_headers', '__return_false' );
View style.css
.pages .pagination {
display: block;
clear: both;
}
.pages .pagination a {
color: #60A7FC;
background-color: #F9FCFF;
border-color: transparent;
}
@dancameron
dancameron / functions.php
Created Nov 15, 2019
Get all Dashboard Links
View functions.php
<?php // don't include this line in your functions.php, since it already starts with it.
remove_action( 'pre_si_invoice_view', array( 'SI_Payment_Terms_Fees', 'show_message_about_term_due' ), 20, 1 );
function _si_get_user_dashboard_links() {
if ( class_exists( 'SI_Client_Dashboard' ) ) {
$args = apply_filters( 'si_get_users_for_association_args', array( 'fields' => array( 'ID', 'user_email', 'display_name' ) ) );
$users = get_users( $args );
You can’t perform that action at this time.