WordPress.org

Make WordPress Core

Changeset 15946


Ignore:
Timestamp:
10/24/10 19:20:52 (3 years ago)
Author:
nacin
Message:

Disable static page dropdowns when 'latest posts' is selected on Settings > Reading. props koopersmith, fixes #15205.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r15889 r15946  
    2222 * 
    2323 * @package WordPress 
    24  * @subpackage General_Settings_Panel 
     24 * @subpackage General_Settings_Screen 
    2525 */ 
    2626function add_js() { 
     
    5757<?php 
    5858} 
    59 add_filter('admin_head', 'add_js'); 
     59add_action('admin_head', 'add_js'); 
    6060 
    6161add_contextual_help($current_screen, 
  • trunk/wp-admin/options-reading.php

    r15810 r15946  
    1515$title = __( 'Reading Settings' ); 
    1616$parent_file = 'options-general.php'; 
     17 
     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'); 
    1743 
    1844add_contextual_help($current_screen, 
Note: See TracChangeset for help on using the changeset viewer.