Check tax object name before modifying label

This commit is contained in:
Shiva Poudel 2016-08-26 21:14:50 +05:45
parent 97819f5a17
commit 330215db42
1 changed files with 8 additions and 4 deletions

View File

@ -231,12 +231,16 @@ 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 ( 'product_cat' === $tax->name ) {
$tax->labels->name = __( 'Product Categories', 'woocommerce' );
} elseif ( 'product_tag' === $tax->name ) {
$tax->labels->name = __( 'Product Tags', 'woocommerce' );
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;