WordPress.org

Make WordPress Core

Ticket #9175: 9175.2.diff

File 9175.2.diff, 1.3 KB (added by Denis-de-Bernardy, 5 years ago)

refreshed against 11256

  • wp-admin/options.php

     
    107107                        $options_to_update[] = $option->option_name; 
    108108                        $class = 'all-options'; 
    109109                } else { 
    110                         $value = 'SERIALIZED DATA'; 
     110                        $value = maybe_unserialize($option->option_value); 
     111                        $value = print_r($value, true); 
    111112                        $disabled = ' disabled="disabled"'; 
    112113                        $class = 'all-options disabled'; 
    113114                } 
     
    121122        <th scope='row'><label for='$option->option_name'>$option->option_name</label></th> 
    122123<td>"; 
    123124 
    124         if (strpos($value, "\n") !== false) echo "<textarea class='$class' name='$option->option_name' id='$option->option_name' cols='30' rows='5'>" . wp_specialchars($value) . "</textarea>"; 
    125         else echo "<input class='regular-text $class' type='text' name='$option->option_name' id='$option->option_name' value='" . esc_attr($value) . "'$disabled />"; 
     125        if ( $rows = substr_count($value, "\n") ) 
     126                echo "<textarea class='$class' name='$option->option_name' id='$option->option_name' cols='30' rows='" . ( $rows >= 10 ? 10 : $rows + 1 ) . "'>" . format_to_edit($value) . "</textarea>"; 
     127        else 
     128                echo "<input class='regular-text $class' type='text' name='$option->option_name' id='$option->option_name' value='" . esc_attr($value) . "'$disabled />"; 
    126129 
    127130        echo "</td> 
    128131</tr>";