Skip to content

Commit

Permalink
Merge pull request #11788 from shivapoudel/nav-obj
Browse files Browse the repository at this point in the history
Check tax object name before modifying label
  • Loading branch information
mikejolley committed Aug 26, 2016
2 parents 97819f5 + 330215d commit fc6fba1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions includes/admin/class-wc-admin-menus.php
Expand Up @@ -231,12 +231,16 @@ public function addons_page() {

/**
* 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;
Expand Down

0 comments on commit fc6fba1

Please sign in to comment.