WordPress.org

Make WordPress Core

Ticket #2456: options.patch

File options.patch, 747 bytes (added by Viper007Bond, 16 years ago)

Handle multi-line option values

  • options.php

     
    101101        echo "
    102102<tr>
    103103        <th scope='row'><label for='$option->option_name'>$option->option_name</label></th>
    104         <td><input type='text' name='$option->option_name' id='$option->option_name' size='30' value='" . $value . "' /></td>
     104<td>";
     105
     106        if (stristr($value, "\n")) echo "<textarea name='$option->option_name' id='$option->option_name' cols='50' rows='5'>$value</textarea>";
     107        else echo "<input type='text' name='$option->option_name' id='$option->option_name' size='30' value='" . $value . "' />";
     108       
     109        echo "</td>
    105110        <td>$option->option_description</td>
    106111</tr>";
    107112endforeach;