Commit e484b981 authored by Peter J. Herrel's avatar Peter J. Herrel Committed by GitHub
Browse files

Merge pull request #108 from diggy/wp-pll-term-duplicate-parent-check

tweak translated term parent check
parents da63dec8 9780b34e
......@@ -223,8 +223,10 @@ class TermCommand extends BaseCommand {
$term_data = get_term( $term_id, $taxonomy, 'ARRAY_A' );
# check for translated post parent
if ( ( $term_parent_id = get_term( $term->parent, $taxonomy ) ) && ( $parent = $this->pll->model->term->get_translation( $term_parent_id, $slug ) ) ) {
if ( ! is_wp_error( $term_parent_id ) ) {
$term_parent_id = get_term( $term->parent, $taxonomy );
if ( $term_parent_id && ! is_wp_error( $term_parent_id ) ) {
if ( $parent = $this->pll->model->term->get_translation( $term_parent_id, $slug ) ) {
$term_data['parent'] = absint( $parent );
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment