Skip to content

Instantly share code, notes, and snippets.

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 alexv66/1198d02589af6a9e11e9bf83aac31b0e to your computer and use it in GitHub Desktop.
Save alexv66/1198d02589af6a9e11e9bf83aac31b0e to your computer and use it in GitHub Desktop.
<?php // only copy this line if needed!
/**
* Filter the Jilt financial status for the order.
*
* @param string $status the financial status
* @param int $order_id the order's ID
* @return string updated status
*/
add_filter( 'wc_jilt_order_financial_status', function( $status, $order_id ) {
// phone orders sets this meta field
$creator_id = get_post_meta( $order_id, '_wpo_order_creator', true );
if ( $creator_id ) {
$status = 'paid';
}
return $status;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment