[woocommerce] カスタムステータスの追加
この記事は、過去の記事や制作物を移動したものです。
記事の内容が古い可能性がございますのでご注意ください。
WooCommerceでカスタムステータスを追加します。
サンプルコード
<?php
add_action( 'init', 'register_order_status' );
function register_order_status()
{
// カスタムステータスの追加
register_post_status(
'wc-my-status',
array(
'label' => 'カスタムステータス',
'public' => false,
'show_in_admin_status_list' => true,
'show_in_admin_all_list' => true,
'exclude_from_search' => true,
'label_count' => _n_noop( $value.' <span class="count">(%s)</span>', $value.' <span class="count">(%s)</span>' )
)
);
}
<?php
register_post_status()