Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r15227 r16980  
    1616$parent_file = 'options-general.php';
    1717
     18/**
     19 * Display JavaScript on the page.
     20 *
     21 * @package WordPress
     22 * @subpackage Reading_Settings_Screen
     23 */
     24function add_js() {
     25?>
     26<script type="text/javascript">
     27//<![CDATA[
     28    jQuery(document).ready(function($){
     29        var section = $('#front-static-pages'),
     30            staticPage = section.find('input:radio[value="page"]'),
     31            selects = section.find('select'),
     32            check_disabled = function(){
     33                selects.attr('disabled', staticPage.is(':checked') ? '' : 'disabled');
     34            };
     35        check_disabled();
     36        section.find('input:radio').change(check_disabled);
     37    });
     38//]]>
     39</script>
     40<?php
     41}
     42add_action('admin_head', 'add_js');
     43
    1844add_contextual_help($current_screen,
    1945    '<p>' . __('This screen contains the settings that affect the display of your content.') . '</p>' .
     
    2248    '<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>' .
    2349    '<p><strong>' . __('For more information:') . '</strong></p>' .
    24     '<p>' . __('<a href="http://codex.wordpress.org/Settings_Reading_SubPanel" target="_blank">Reading Settings Documentation</a>') . '</p>' .
     50    '<p>' . __('<a href="http://codex.wordpress.org/Settings_Reading_SubPanel" target="_blank">Documentation on Reading Settings</a>') . '</p>' .
    2551    '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    2652);
     
    3965<input name="show_on_front" type="hidden" value="posts" />
    4066<table class="form-table">
    41 <?php else :
     67<?php
     68    if ( 'posts' != get_option( 'show_on_front' ) ) :
     69        update_option( 'show_on_front', 'posts' );
     70    endif;
     71
     72else :
    4273    if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) )
    4374        update_option( 'show_on_front', 'posts' );
     
    95126<?php do_settings_sections( 'reading' ); ?>
    96127
    97 <p class="submit">
    98     <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes' ); ?>" />
    99 </p>
     128<?php submit_button(); ?>
    100129</form>
    101130</div>
Note: See TracChangeset for help on using the changeset viewer.