Added empty categories to the product exporter admin view

This commit is contained in:
Christopher Allford 2019-11-27 12:08:56 -08:00
parent 278cf53f2f
commit 44aed47f4d
1 changed files with 7 additions and 1 deletions

View File

@ -64,7 +64,13 @@ $exporter = new WC_Product_CSV_Exporter();
<td>
<select id="woocommerce-exporter-category" class="woocommerce-exporter-category wc-enhanced-select" style="width:100%;" multiple data-placeholder="<?php esc_attr_e( 'Export all categories', 'woocommerce' ); ?>">
<?php
foreach ( get_categories( array( 'taxonomy' => 'product_cat' ) ) as $category ) {
$categories = get_categories(
array(
'taxonomy' => 'product_cat',
'hide_empty' => false,
)
);
foreach ( $categories as $category ) {
echo '<option value="' . esc_attr( $category->slug ) . '">' . esc_html( $category->name ) . '</option>';
}
?>