Check tax object name before modifying label
This commit is contained in:
parent
97819f5a17
commit
330215db42
|
@ -231,13 +231,17 @@ class WC_Admin_Menus {
|
|||
|
||||
/**
|
||||
* Rename taxonomies in admin menus meta boxes.
|
||||
* @param object $tax
|
||||
* @return object
|
||||
*/
|
||||
public function rename_nav_menu_meta_boxes( $tax ) {
|
||||
if ( isset( $tax->name ) ) {
|
||||
if ( 'product_cat' === $tax->name ) {
|
||||
$tax->labels->name = __( 'Product Categories', 'woocommerce' );
|
||||
} elseif ( 'product_tag' === $tax->name ) {
|
||||
$tax->labels->name = __( 'Product Tags', 'woocommerce' );
|
||||
}
|
||||
}
|
||||
|
||||
return $tax;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue