WordPress.org

Make WordPress Core

Ticket #9175: 9175.3.diff

File 9175.3.diff, 1.1 KB (added by MZAWeb, 6 years ago)

Updated 9175.2.diff for 19712

  • wp-admin/options.php

     
    190190                        $options_to_update[] = $option->option_name;
    191191                        $class = 'all-options';
    192192                } else {
    193                         $value = 'SERIALIZED DATA';
     193                        $value = print_r(maybe_unserialize( $option->option_value ), true);
    194194                        $disabled = true;
    195195                        $class = 'all-options disabled';
    196196                }
     
    204204<tr>
    205205        <th scope='row'><label for='$name'>" . esc_html( $option->option_name ) . "</label></th>
    206206<td>";
    207         if ( strpos( $value, "\n" ) !== false )
    208                 echo "<textarea class='$class' name='$name' id='$name' cols='30' rows='5'>" . esc_textarea( $value ) . "</textarea>";
     207    if ( $rows = substr_count($value, "\n") )
     208                echo "<textarea class='$class' name='$name' id='$name' cols='30' rows='$rows'>" . esc_textarea( $value ) . "</textarea>";
    209209        else
    210210                echo "<input class='regular-text $class' type='text' name='$name' id='$name' value='" . esc_attr( $value ) . "'" . disabled( $disabled, true, false ) . " />";
    211211        echo "</td>