Skip to content

Instantly share code, notes, and snippets.

@zorem
Last active March 14, 2023 09:57
Show Gist options
  • Save zorem/1f62121b35b4a86764252723656abf1a to your computer and use it in GitHub Desktop.
Save zorem/1f62121b35b4a86764252723656abf1a to your computer and use it in GitHub Desktop.
Set Order Status to Shipped(Completed) when adding tracking information with REST API
// Add this code to your theme functions.php file or a custom plugin
function ast_api_create_item_arg_filter( $args ) {
$args['status_shipped'] = 1;
return $args;
}
add_filter( 'ast_api_create_item_arg', 'ast_api_create_item_arg_filter', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment