PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 4.0.3
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v4.0.3
4.0.3 4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 341 releases
← All changes | assets/lib/wck-api/fields/radio.php +34 -32 3.9.6 → 4.0.3 View file →
@@ -6,40 +6,42 @@
6 6 * @return string $element input element html string. */
7 7
8 8 if( !empty( $details['options'] ) ){
9 9 $element .= '<div class="wck-radiobuttons">';
10 - foreach( $details['options'] as $option ){
11 - $found = false;
12 -
13 - $values = explode( ', ', $value );
14 - if( strpos( $option, '%' ) === false ){
15 - $label = $option;
16 - $value_attr = $option;
17 - if ( in_array( $option, $values ) )
18 - $found = true;
19 - }
20 - else{
21 - $option_parts = explode( '%', $option );
22 - if( !empty( $option_parts ) ){
23 - if( empty( $option_parts[0] ) && count( $option_parts ) == 3 ){
24 - $label = $option_parts[1];
25 - $value_attr = $option_parts[2];
26 - if ( in_array( $option_parts[2], $values ) )
27 - $found = true;
28 - }
29 - }
30 - }
31 -
32 - $element .= '<div><label><input type="radio" name="'. $single_prefix . esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ) ) .'" id="';
33 - if( !empty( $frontend_prefix ) )
34 - $element .= $frontend_prefix;
10 + $element .= '<div class="cozmoslabs-radio-inputs-row">';
11 + foreach( $details['options'] as $option ){
12 + $found = false;
35 13
36 - /* since the slug below is generated from the value as well we need to determine here if we have a slug or not and not let the wck_generate_slug() function do that */
37 - if( !empty( $details['slug'] ) )
38 - $slug_from = $details['slug'];
39 - else
40 - $slug_from = $details['title'];
41 - $element .= esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $slug_from . '_' . $value_attr ) ) .'" value="'. esc_attr( $value_attr ) .'" '. checked( $found, true, false ) .'class="mb-radio mb-field" />'. esc_html( $label ) .'</label></div>';
42 - }
14 + $values = explode( ', ', $value );
15 + if( strpos( $option, '%' ) === false ){
16 + $label = $option;
17 + $value_attr = $option;
18 + if ( in_array( $option, $values ) )
19 + $found = true;
20 + }
21 + else{
22 + $option_parts = explode( '%', $option );
23 + if( !empty( $option_parts ) ){
24 + if( empty( $option_parts[0] ) && count( $option_parts ) == 3 ){
25 + $label = $option_parts[1];
26 + $value_attr = $option_parts[2];
27 + if ( in_array( $option_parts[2], $values ) )
28 + $found = true;
29 + }
30 + }
31 + }
32 +
33 + $element .= '<label><input type="radio" name="'. $single_prefix . esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ) ) .'" id="';
34 + if( !empty( $frontend_prefix ) )
35 + $element .= $frontend_prefix;
36 +
37 + /* since the slug below is generated from the value as well we need to determine here if we have a slug or not and not let the wck_generate_slug() function do that */
38 + if( !empty( $details['slug'] ) )
39 + $slug_from = $details['slug'];
40 + else
41 + $slug_from = $details['title'];
42 + $element .= esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $slug_from . '_' . $value_attr ) ) .'" value="'. esc_attr( $value_attr ) .'" '. checked( $found, true, false ) .'class="mb-radio mb-field" />'. esc_html( $label ) .'</label>';
43 + }
44 + $element .= '</div>';
43 45 $element .= '</div>';
44 46 }
45 47 ?>