Skip to content

Commit

Permalink
Created the WC_Webhook::get_i18n_status() method
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiosanches committed Dec 16, 2014
1 parent 1198a1d commit 8180de7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion includes/admin/class-wc-admin-post-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ public function render_shop_webhook_columns( $column ) {

break;
case 'webhook_status' :
echo $the_webhook->get_status();
echo $the_webhook->get_i18n_status();
break;
case 'webhook_topic' :
echo $the_webhook->get_topic();
Expand Down
16 changes: 16 additions & 0 deletions includes/class-wc-webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,22 @@ public function get_status() {
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
*
Expand Down

0 comments on commit 8180de7

Please sign in to comment.