1
管理順序リストに一括操作完了ステータスの名前を変更私はすでにこのコードWooCommerce -
function wc_renaming_order_status($order_statuses) {
foreach ($order_statuses as $key => $status) {
$new_order_statuses[ $key ] = $status;
if ('wc-completed' === $key) {
$order_statuses['wc-completed'] = _x('Paid', 'Order status', 'woocommerce');
}
}
return $order_statuses;
}
add_filter('wc_order_statuses', 'wc_renaming_order_status');
そして今、私は私のために大量のオプションの名前を変更する必要がありますを使用して「有給」に「完了」私の注文状況と改名しましたリスト管理者。どのように
できadd_action('admin_footer-edit.php', 'custom_bulk_admin_footer');
function custom_bulk_admin_footer() {
global $post_type;
if($post_type == 'shop_order') {
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('<option>').val('shipped').text('<?php _e('Mark as shipped')?>').appendTo("select[name='action']");
jQuery('<option>').val('shipped').text('<?php _e('Mark as shipped')?>').appendTo("select[name='action2']");
});
</script>
<?php
}
}
しかし、新しいオプションを追加するためだけに働いていた、私が本当に必要なことは「完了としてマーク」「支払わとしてマーク」に大量のオプションの名前を変更することです:私はこのコードを使用しました 私はこれを解決する?
おかげ