Changeset 1079928
- Timestamp:
- 02/01/2015 04:15:55 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
conditional-logic-solution/trunk/lib/basefield.php
r1072545 r1079928 45 45 'name' => '', 46 46 'id' => '', 47 'div_class' => '', 47 48 'echo' => true 48 49 )); … … 56 57 extract( $args ); 57 58 58 foreach( array('label', 'sub', 'choices', 'echo', 'buttons', 'before', 'after', 'selected' ) as $extra ){ unset( $args[$extra]); } 59 foreach( array('div_class', 'label', 'sub', 'choices', 'echo', 'buttons', 'before', 'after', 'selected' ) as $extra ){ unset( $args[$extra]); } 60 59 61 $label_class = apply_filters( 'basefield_label_class', array('bf-title') ); 60 62 $label_attr = array('class' => implode(" ", $label_class)); … … 179 181 $html .= $after; 180 182 181 if( !empty( $sub ) ){ 182 $html .= basefield_tag( 'i', array('class' => 'bf-sub'), $sub ); 183 } 183 if( !empty( $sub ) ) $html .= basefield_tag( 'p', array('class' => 'bf-sub'), $sub ); 184 184 185 $name = preg_replace('%[\[\]]%', '', $name); 185 186 $name = empty($name) ? $id : $name; 186 $html = basefield_tag('div', apply_filters( 'basefield_wrapper', array('class' => 'bf-div bf-'. $name ), $html, $args ), $html ); 187 $div_class = explode(' ', $div_class); 188 $div_class[] = 'bf-' . $name; 189 array_unshift( $div_class, 'bf-div' ); 190 191 $div_args = array('class' => implode(' ', $div_class ) ); 192 193 if( $type == 'html' ) $div_args = wp_parse_args( $div_args, $args ); 194 195 unset( $div_args['type'] ); 196 197 $html = basefield_tag('div', apply_filters( 'basefield_wrapper', $div_args, $html, $args ), $html ); 187 198 if( $echo ) _e( $html ); 188 199 else return $html;
Note: See TracChangeset
for help on using the changeset viewer.