PHP 8.2.31
Preview: radio.php Size: 2.18 KB
/home/nshryvcy/taramarriagebureau.com/wp-content/plugins/profile-builder/assets/lib/wck-api/fields/radio.php

<?php
 /* @param string $meta Meta name.	 
 * @param array $details Contains the details for the field.	 
 * @param string $value Contains input value;
 * @param string $context Context where the function is used. Depending on it some actions are preformed.;
 * @return string $element input element html string. */

if( !empty( $details['options'] ) ){
	$element .= '<div class="wck-radiobuttons">';
        $element .= '<div class="cozmoslabs-radio-inputs-row">';
        foreach( $details['options'] as $option ){
            $found = false;

            $values = explode( ', ', $value );
            if( strpos( $option, '%' ) === false  ){
                $label = $option;
                $value_attr = $option;
                if ( in_array( $option, $values ) )
                    $found = true;
            }
            else{
                $option_parts = explode( '%', $option );
                if( !empty( $option_parts ) ){
                    if( empty( $option_parts[0] ) && count( $option_parts ) == 3 ){
                        $label = $option_parts[1];
                        $value_attr = $option_parts[2];
                        if ( in_array( $option_parts[2], $values ) )
                            $found = true;
                    }
                }
            }

            $element .= '<label><input type="radio" name="'. $single_prefix . esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ) ) .'" id="';
            if( !empty( $frontend_prefix ) )
                $element .=	$frontend_prefix;

            /* 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 */
            if( !empty( $details['slug'] ) )
                $slug_from = $details['slug'];
            else
                $slug_from = $details['title'];
            $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>';
        }
        $element .= '</div>';
	$element .= '</div>';
}
?>

Directory Contents

Dirs: 0 × Files: 16

Name Size Perms Modified Actions
3.65 KB lrw-r--r-- 2025-04-30 03:15:48
Edit Download
1.15 KB lrw-r--r-- 2025-04-30 03:15:48
Edit Download
1.32 KB lrw-r--r-- 2025-04-30 03:15:48
Edit Download
937 B lrw-r--r-- 2025-04-30 03:15:48
Edit Download
454 B lrw-r--r-- 2025-04-30 03:15:48
Edit Download
930 B lrw-r--r-- 2025-04-30 03:15:48
Edit Download
2.18 KB lrw-r--r-- 2025-04-30 03:15:48
Edit Download
2.99 KB lrw-r--r-- 2025-04-30 03:15:48
Edit Download
2.40 KB lrw-r--r-- 2025-04-30 03:15:48
Edit Download
2.18 KB lrw-r--r-- 2025-04-30 03:15:48
Edit Download
827 B lrw-r--r-- 2025-04-30 03:15:48
Edit Download
731 B lrw-r--r-- 2025-04-30 03:15:48
Edit Download
5.11 KB lrw-r--r-- 2025-04-30 03:15:48
Edit Download
3.50 KB lrw-r--r-- 2025-04-30 03:15:48
Edit Download
1.14 KB lrw-r--r-- 2025-04-30 03:15:48
Edit Download
896 B lrw-r--r-- 2025-04-30 03:15:48
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).