Skip to content

Commit

Permalink
Don't wrap input in label tag if desc arg is empty
Browse files Browse the repository at this point in the history
This allows to avoid unnecessary wrapping and generate label element separately from the input.
  • Loading branch information
dikiyforester committed Oct 15, 2015
1 parent e766eda commit 7d3b549
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Forms.php
Expand Up @@ -606,6 +606,10 @@ protected static function _input_gen( $args ) {
* @return string
*/
protected static function add_label( $input, $desc, $desc_pos ) {
if ( empty( $desc ) ) {
return $input;
}

return html( 'label', self::add_desc( $input, $desc, $desc_pos ) ) . "\n";
}

Expand Down

0 comments on commit 7d3b549

Please sign in to comment.