WC_Admin_Taxonomies::product_cat_notes()publicWC 1.0

Add some notes to describe the behavior of the default category.

Method of the class: WC_Admin_Taxonomies{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Admin_Taxonomies = new WC_Admin_Taxonomies();
$WC_Admin_Taxonomies->product_cat_notes();

WC_Admin_Taxonomies::product_cat_notes() code WC 9.4.2

<?php
public function product_cat_notes() {
	$category_id   = get_option( 'default_product_cat', 0 );
	$category      = get_term( $category_id, 'product_cat' );
	$category_name = ( ! $category || is_wp_error( $category ) ) ? _x( 'Uncategorized', 'Default category slug', 'woocommerce' ) : $category->name;
	?>
	<div class="form-wrap edit-term-notes">
		<p>
			<strong><?php esc_html_e( 'Note:', 'woocommerce' ); ?></strong><br>
			<?php
				printf(
					/* translators: %s: default category */
					esc_html__( 'Deleting a category does not delete the products in that category. Instead, products that were only assigned to the deleted category are set to the category %s.', 'woocommerce' ),
					'<strong>' . esc_html( $category_name ) . '</strong>'
				);
			?>
		</p>
	</div>
	<?php
}