Skip to content

Commit

Permalink
fix(terms): avoid notice for unknown variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Mte90 committed Apr 29, 2021
1 parent ca904f0 commit 83a2aff
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions class.wph-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,18 +694,19 @@ function create_field_taxonomyterm($key, $out = "") {
$out .= ' selected="selected" ';
}
$out .= '> ' . esc_html($term->name) . ' </option>';
}
$subterms = get_terms($taxonomy->name, array(
'parent' => $term->term_id
) );
$subterms = get_terms($term->name, array(
'parent' => $term->term_id
) );

foreach ($subterms as $subterm) {
$out .= '<option value="' . esc_attr__($subterm->slug) . '" ';
if (esc_attr($selected) == $subterm->slug) {
$out .= ' selected="selected" ';
}
$out .= '> - ' . esc_html($subterm->name) . ' </option>';
}
foreach ($subterms as $subterm) {
$out .= '<option value="' . esc_attr__($subterm->slug) . '" ';
if (esc_attr($selected) == $subterm->slug) {
$out .= ' selected="selected" ';
}
$out .= '> - ' . esc_html($subterm->name) . ' </option>';
}
}
$out .= ' </select> ';
$out .= '</div>';
endforeach;
Expand Down

0 comments on commit 83a2aff

Please sign in to comment.