Created the WC_Webhook::get_i18n_status() method
This commit is contained in:
parent
1198a1dba2
commit
8180de7fec
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue