Unverified Commit 9780b34e authored by Peter J. Herrel's avatar Peter J. Herrel
Browse files

tweak translated term parent check

parent da63dec8
......@@ -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