Forked from bekarice/update-jilt-financial-status.php
Last active
February 26, 2020 05:20
-
-
Save alexv66/1198d02589af6a9e11e9bf83aac31b0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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