WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/10/2015 09:44:29 PM (6 years ago)
Author:
wonderboymusic
Message:

Move ad hoc Options functions to wp-admin/includes/options.php:

  • Move options_discussion_add_js() from wp-admin/options-discussion.php
  • Move options_general_add_js() from wp-admin/options-general.php
  • Move options_permalink_add_js() from wp-admin/options-permalink.php
  • Move options_reading_add_js() from wp-admin/options-reading.php
  • Move options_reading_blog_charset() from wp-admin/options-reading.php

See #33813.

File:
1 edited

Legend:

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

    r32974 r34022  
    1616$parent_file = 'options-general.php';
    1717
    18 /**
    19  * Display JavaScript on the page.
    20  *
    21  * @since 3.5.0
    22  */
    23 function options_reading_add_js() {
    24 ?>
    25 <script type="text/javascript">
    26     jQuery(document).ready(function($){
    27         var section = $('#front-static-pages'),
    28             staticPage = section.find('input:radio[value="page"]'),
    29             selects = section.find('select'),
    30             check_disabled = function(){
    31                 selects.prop( 'disabled', ! staticPage.prop('checked') );
    32             };
    33         check_disabled();
    34         section.find('input:radio').change(check_disabled);
    35     });
    36 </script>
    37 <?php
    38 }
    3918add_action('admin_head', 'options_reading_add_js');
    40 
    41 /**
    42  * Render the blog charset setting.
    43  *
    44  * @since 3.5.0
    45  */
    46 function options_reading_blog_charset() {
    47     echo '<input name="blog_charset" type="text" id="blog_charset" value="' . esc_attr( get_option( 'blog_charset' ) ) . '" class="regular-text" />';
    48     echo '<p class="description">' . __( 'The <a href="https://codex.wordpress.org/Glossary#Character_set">character encoding</a> of your site (UTF-8 is recommended)' ) . '</p>';
    49 }
    5019
    5120get_current_screen()->add_help_tab( array(
Note: See TracChangeset for help on using the changeset viewer.