WordPress.org

Make WordPress Core

Ticket #21564: 21564.patch

File 21564.patch, 7.5 KB (added by bpetty, 20 months ago)
  • wp-admin/export.php

    diff --git wp-admin/export.php wp-admin/export.php
    index 8257b51..033fe4b 100644
    if ( !current_user_can('export') ) 
    1616require_once('./includes/export.php'); 
    1717$title = __('Export'); 
    1818 
    19 function add_js() { 
     19function add_js_for_wp_admin_export() { 
    2020?> 
    2121<script type="text/javascript"> 
    2222//<![CDATA[ 
    function add_js() { 
    3636</script> 
    3737<?php 
    3838} 
    39 add_action( 'admin_head', 'add_js' ); 
     39add_action( 'admin_head', 'add_js_for_wp_admin_export' ); 
    4040 
    4141get_current_screen()->add_help_tab( array( 
    4242        'id'      => 'overview', 
  • wp-admin/install.php

    diff --git wp-admin/install.php wp-admin/install.php
    index e39d1f4..0e2db82 100644
    $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0; 
    5050 * @package WordPress 
    5151 * @subpackage Installer 
    5252 */ 
    53 function display_header() { 
     53function display_install_header() { 
    5454        header( 'Content-Type: text/html; charset=utf-8' ); 
    5555?> 
    5656<!DOCTYPE html> 
    function display_header() { 
    6464<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png?ver=20120216" /></h1> 
    6565 
    6666<?php 
    67 } // end display_header() 
     67} // end display_install_header() 
    6868 
    6969/** 
    7070 * Display installer setup form. 
    function display_setup_form( $error = null ) { 
    141141 
    142142// Let's check to make sure WP isn't already installed. 
    143143if ( is_blog_installed() ) { 
    144         display_header(); 
     144        display_install_header(); 
    145145        die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p><p class="step"><a href="../wp-login.php" class="button">' . __('Log In') . '</a></p></body></html>' ); 
    146146} 
    147147 
    elseif ( !$mysql_compat ) 
    158158        $compat = sprintf( __( 'You cannot install because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_mysql_version, $mysql_version ); 
    159159 
    160160if ( !$mysql_compat || !$php_compat ) { 
    161         display_header(); 
     161        display_install_header(); 
    162162        die( '<h1>' . __( 'Insufficient Requirements' ) . '</h1><p>' . $compat . '</p></body></html>' ); 
    163163} 
    164164 
    165165if ( ! is_string( $wpdb->base_prefix ) || '' === $wpdb->base_prefix ) { 
    166         display_header(); 
     166        display_install_header(); 
    167167        die( '<h1>' . __( 'Configuration Error' ) . '</h1><p>' . __( 'Your <code>wp-config.php</code> file has an empty database table prefix, which is not supported.' ) . '</p></body></html>' ); 
    168168} 
    169169 
    170170switch($step) { 
    171171        case 0: // Step 1 
    172172        case 1: // Step 1, direct link. 
    173           display_header(); 
     173          display_install_header(); 
    174174?> 
    175175<h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1> 
    176176<p><?php printf( __( 'Welcome to the famous five minute WordPress installation process! You may want to browse the <a href="%s">ReadMe documentation</a> at your leisure. Otherwise, just fill in the information below and you&#8217;ll be on your way to using the most extendable and powerful personal publishing platform in the world.' ), '../readme.html' ); ?></p> 
    switch($step) { 
    185185                if ( ! empty( $wpdb->error ) ) 
    186186                        wp_die( $wpdb->error->get_error_message() ); 
    187187 
    188                 display_header(); 
     188                display_install_header(); 
    189189                // Fill in the data we gathered 
    190190                $weblog_title = isset( $_POST['weblog_title'] ) ? trim( stripslashes( $_POST['weblog_title'] ) ) : ''; 
    191191                $user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin'; 
  • wp-admin/options-general.php

    diff --git wp-admin/options-general.php wp-admin/options-general.php
    index d8a8b80..65fdd0d 100644
    $timezone_format = _x('Y-m-d G:i:s', 'timezone date format'); 
    2323 * @package WordPress 
    2424 * @subpackage General_Settings_Screen 
    2525 */ 
    26 function add_js() { 
     26function add_js_for_wp_admin_general_options() { 
    2727?> 
    2828<script type="text/javascript"> 
    2929//<![CDATA[ 
    function add_js() { 
    5656</script> 
    5757<?php 
    5858} 
    59 add_action('admin_head', 'add_js'); 
     59add_action('admin_head', 'add_js_for_wp_admin_general_options'); 
    6060 
    6161$options_help = '<p>' . __('The fields on this screen determine some of the basics of your site setup.') . '</p>' . 
    6262        '<p>' . __('Most themes display the site title at the top of every page, in the title bar of the browser, and as the identifying name for syndicated feeds. The tagline is also displayed by many themes.') . '</p>'; 
  • wp-admin/options-permalink.php

    diff --git wp-admin/options-permalink.php wp-admin/options-permalink.php
    index 9ccb62f..8d79a92 100644
    get_current_screen()->set_help_sidebar( 
    5252 * @package WordPress 
    5353 * @subpackage Permalink_Settings_Screen 
    5454 */ 
    55 function add_js() { 
     55function add_js_for_wp_admin_permalink_options() { 
    5656        ?> 
    5757<script type="text/javascript"> 
    5858//<![CDATA[ 
    jQuery(document).ready(function() { 
    7070</script> 
    7171<?php 
    7272} 
    73 add_filter('admin_head', 'add_js'); 
     73add_filter('admin_head', 'add_js_for_wp_admin_permalink_options'); 
    7474 
    7575include('./admin-header.php'); 
    7676 
  • wp-admin/options-reading.php

    diff --git wp-admin/options-reading.php wp-admin/options-reading.php
    index d1ff70f..7cf203c 100644
    $parent_file = 'options-general.php'; 
    2121 * @package WordPress 
    2222 * @subpackage Reading_Settings_Screen 
    2323 */ 
    24 function add_js() { 
     24function add_js_for_wp_admin_reading_options() { 
    2525?> 
    2626<script type="text/javascript"> 
    2727//<![CDATA[ 
    function add_js() { 
    3939</script> 
    4040<?php 
    4141} 
    42 add_action('admin_head', 'add_js'); 
     42add_action('admin_head', 'add_js_for_wp_admin_reading_options'); 
    4343 
    4444get_current_screen()->add_help_tab( array( 
    4545        'id'      => 'overview', 
  • wp-admin/setup-config.php

    diff --git wp-admin/setup-config.php wp-admin/setup-config.php
    index 6201b00..ead58d6 100644
    $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0; 
    8383 * @package WordPress 
    8484 * @subpackage Installer_WP_Config 
    8585 */ 
    86 function display_header() { 
     86function display_setup_config_header() { 
    8787        global $wp_version; 
    8888 
    8989        header( 'Content-Type: text/html; charset=utf-8' ); 
    function display_header() { 
    9999<body<?php if ( is_rtl() ) echo ' class="rtl"'; ?>> 
    100100<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png?ver=20120216" /></h1> 
    101101<?php 
    102 }//end function display_header(); 
     102}//end function display_setup_config_header(); 
    103103 
    104104switch($step) { 
    105105        case 0: 
    106                 display_header(); 
     106                display_setup_config_header(); 
    107107?> 
    108108 
    109109<p><?php _e( 'Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.' ) ?></p> 
    switch($step) { 
    122122        break; 
    123123 
    124124        case 1: 
    125                 display_header(); 
     125                display_setup_config_header(); 
    126126        ?> 
    127127<form method="post" action="setup-config.php?step=2"> 
    128128        <p><?php _e( "Below you should enter your database connection details. If you're not sure about these, contact your host." ); ?></p> 
    switch($step) { 
    251251        unset( $line ); 
    252252 
    253253        if ( ! is_writable(ABSPATH) ) : 
    254                 display_header(); 
     254                display_setup_config_header(); 
    255255?> 
    256256<p><?php _e( "Sorry, but I can't write the <code>wp-config.php</code> file." ); ?></p> 
    257257<p><?php _e( 'You can create the <code>wp-config.php</code> manually and paste the following text into it.' ); ?></p> 
    switch($step) { 
    270270                } 
    271271                fclose($handle); 
    272272                chmod(ABSPATH . 'wp-config.php', 0666); 
    273                 display_header(); 
     273                display_setup_config_header(); 
    274274?> 
    275275<p><?php _e( "All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to&hellip;" ); ?></p> 
    276276