Skip to content

Commit

Permalink
Fix migrating Woo's product categories from SEOPress (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatrangnet authored Dec 6, 2023
1 parent d42d3e0 commit 6ed531b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Migration/Sources/SEOPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ protected function get_post_noindex( $post_id ): int {
}

protected function before_migrate_term( $term_id ) {
$this->context = seopress_get_service( 'ContextPage' )->buildContextWithCurrentId( $term_id, [ 'type' => 'term' ] )->getContext();
add_filter( 'seopress_primary_category_list', '__return_empty_array' );
$term = get_term( $term_id );
$this->context = seopress_get_service( 'ContextPage' )->buildContextWithCurrentId( $term_id, [ 'type' => 'term', 'taxonomy' => $term->taxonomy ] )->getContext();
}

protected function get_term_title( $term_id ) {
Expand Down

0 comments on commit 6ed531b

Please sign in to comment.