WordPress.org

Make WordPress Core

Changeset 21467


Ignore:
Timestamp:
08/07/2012 03:10:59 AM (8 years ago)
Author:
nacin
Message:

Hide the charset setting for installs that have a charset of UTF-8 already. fixes #21507.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-reading.php

    r20605 r21467  
    121121</tr>
    122122
    123 <tr valign="top">
    124 <th scope="row"><label for="blog_charset"><?php _e( 'Encoding for pages and feeds' ); ?></label></th>
    125 <td><input name="blog_charset" type="text" id="blog_charset" value="<?php form_option( 'blog_charset' ); ?>" class="regular-text" />
    126 <p class="description"><?php _e( 'The <a href="http://codex.wordpress.org/Glossary#Character_set">character encoding</a> of your site (UTF-8 is recommended, if you are adventurous there are some <a href="http://en.wikipedia.org/wiki/Character_set">other encodings</a>)' ); ?></p></td>
    127 </tr>
    128 <?php do_settings_fields( 'reading', 'default' ); ?>
     123<?php
     124function options_reading_blog_charset() {
     125    echo '<input name="blog_charset" type="text" id="blog_charset" value="' . esc_attr( get_option( 'blog_charset' ) ) . '" class="regular-text" />';
     126    echo '<p class="description">' . __( 'The <a href="http://codex.wordpress.org/Glossary#Character_set">character encoding</a> of your site (UTF-8 is recommended)' )
     127        . '</p>';
     128}
     129
     130if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) )
     131    add_settings_field( 'blog_charset', __( 'Encoding for pages and feeds' ), 'options_reading_blog_charset', 'reading' );
     132
     133do_settings_fields( 'reading', 'default' ); ?>
    129134</table>
    130135
Note: See TracChangeset for help on using the changeset viewer.