FallBack if missing label from settings
-
in file class.yith-wcan-navigation-widget.php, I change this:
if ( $label ) { echo '<li ' . $class . '>'; echo ( $count > 0 || $option_is_set ) ? '<a ' . $rel_nofollow . ' title="' . $term->name . '" href="' . $link . '">' : '<span>'; echo $label; echo ( $count > 0 || $option_is_set ) ? '</a>' : '</span>'; }
with this:
if (!$label) { $label = $term->name; } if ( $label ) { echo '<li ' . $class . '>'; echo ( $count > 0 || $option_is_set ) ? '<a ' . $rel_nofollow . ' title="' . $term->name . '" href="' . $link . '">' : '<span>'; echo $label; echo ( $count > 0 || $option_is_set ) ? '</a>' : '</span>'; }
and in file functions.yith-wcan.php, I change this:
$return .= "<tr><td><label for='{$id}{$term->term_id}'>{$term->name}</label></td><td><input type='text' id='{$id}{$term->term_id}' name='{$name}[labels][{$term->term_id}]' value='" . ( isset( $values[$term->term_id] ) ? $values[$term->term_id] : '' ) . "' size='3' /></td></tr>";
with this:
$return .= "<tr><td><label for='{$id}{$term->term_id}'>{$term->name}</label></td><td><input type='text' id='{$id}{$term->term_id}' name='{$name}[labels][{$term->term_id}]' value='" . ( !empty( $values[$term->term_id] ) ? $values[$term->term_id] : $term->name ) . "' size='3' /></td></tr>";
and this will solve the problem with Type = Label if labels is empty !
- The topic ‘FallBack if missing label from settings’ is closed to new replies.