Skip to content

Instantly share code, notes, and snippets.

@CrispDev
Last active May 15, 2019 18:58
Show Gist options
  • Save CrispDev/8cbdd9aaa816e6471158edc610216e2a to your computer and use it in GitHub Desktop.
Save CrispDev/8cbdd9aaa816e6471158edc610216e2a to your computer and use it in GitHub Desktop.
Autoship Customization // Customize Order Status Nicenames
/**
* Filter the Status names displayed in the Native Scheduled Order dashboard and order detail page.
* @param array $statuses The current status and it's display name.
* @return array
*/
function xx_adjust_autoship_status_nicenames( $statuses ){
// Optionally use autoship_rights_checker() to determine which version of nicenames to display
return array (
'Active' => 'Scheduled',
'Locked' => 'Processing',
'Pending' => 'Pending',
'Failed' => 'Order Failed',
'Paused' => 'Being Fulfilled',
'Deleted' => 'No Longer Valid',
);
}
add_filter( 'autoship_get_scheduled_order_status_nicenames', 'xx_adjust_autoship_status_nicenames', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment