add_filter( 'dgwt/wcas/labels', function ( $labels ) { $labels['sku_label'] = 'ISBN:'; return $labels; } ); add_filter( 'gettext', function( $translated, $text, $domain ) { if ( $text === 'Your search history' ) { return 'Búsquedas recientes'; } if ( $text === 'Clear' ) { return 'Borrar'; } return $translated; }, 20, 3 ); add_action( 'template_redirect', function() { if ( ! is_tax( 'product_cat' ) ) { return; } $term = get_queried_object(); if ( ! $term || empty( $term->term_id ) ) { return; } $autor_root = get_term_by( 'slug', 'autor', 'product_cat' ); if ( ! $autor_root || is_wp_error( $autor_root ) ) { return; } $is_author_branch = ( (int) $term->term_id === (int) $autor_root->term_id || term_is_ancestor_of( $autor_root->term_id, $term->term_id, 'product_cat' ) ); if ( ! $is_author_branch ) { return; } $author_post = get_page_by_title( $term->name, OBJECT, 'autores' ); if ( ! $author_post ) { $author_post = get_page_by_path( $term->slug, OBJECT, 'autores' ); } if ( $author_post && ! is_wp_error( $author_post ) && $author_post->post_status === 'publish' ) { wp_redirect( get_permalink( $author_post->ID ), 301 ); exit; } } );