Created the WC_Webhook::get_i18n_status() method

This commit is contained in:
Claudio Sanches 2014-12-16 15:29:37 -02:00
parent 1198a1dba2
commit 8180de7fec
2 changed files with 17 additions and 1 deletions

View File

@ -736,7 +736,7 @@ class WC_Admin_Post_Types {
break;
case 'webhook_status' :
echo $the_webhook->get_status();
echo $the_webhook->get_i18n_status();
break;
case 'webhook_topic' :
echo $the_webhook->get_topic();

View File

@ -629,6 +629,22 @@ class WC_Webhook {
return apply_filters( 'woocommerce_webhook_status', $status, $this->id );
}
/**
* Get the webhook i18n status
*
* @return string
*/
public function get_i18n_status() {
$status = $this->get_status();
$statuses = apply_filters( 'woocommerce_webhook_i18n_statuses', array(
'active' => __( 'Active', 'woocommerce' ),
'paused' => __( 'Paused', 'woocommerce' ),
'disabled' => __( 'Disabled', 'woocommerce' ),
) );
return isset( $statuses[ $status ] ) ? $statuses[ $status ] : $status;
}
/**
* Update the webhook status, see get_status() for valid statuses
*