Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(rgar($field,"cssClass") == "multi-choice"){
- $string = "<label class='gfield_label'>".__( 'Choose a teacher', 'my_theme' )."</label>";
- $string .= "<ul class='multi-select'>";
- $field_labels = array(1 => __( '1. choice', 'my_theme' ), 2 => __( '2. choice', 'my_theme' ),3 => __( '3. choice', 'my_theme' ));
- for($i=1;$i<=3;$i++){
- $string .= "<li>";
- $field_string = preg_replace("/(input_\\d{1,2}_\\d{1,2})/is", "$1_$i", $content); //Adjust field and label ID
- $field_string = preg_replace("/(<label[^>]+\>)(.*)(<\/label>)/s", "\$1"." ".$field_labels[$i]."$3", $field_string); //Replace each label
- $string .= $field_string;
- $string .= "</li>";
- }
- $string .= "</ul>";
- $content = $string;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement