Make WordPress Core


Ignore:
Timestamp:
10/21/2015 03:50:19 AM (9 years ago)
Author:
wonderboymusic
Message:

Plugins/Updates: in request_filesystem_credentials(), alter the heading HTML tag based on the current screen for improved semantics.

Props afercia.
Fixes #34267.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r35221 r35315  
    10021002 * @todo Properly mark optional arguments as such
    10031003 *
     1004 * @global string $pagenow
     1005 *
    10041006 * @param string $form_post    the URL to post the form to
    10051007 * @param string $type         the chosen Filesystem method in use
     
    10111013 */
    10121014function request_filesystem_credentials($form_post, $type = '', $error = false, $context = false, $extra_fields = null, $allow_relaxed_file_ownership = false ) {
     1015    global $pagenow;
    10131016
    10141017    /**
     
    11421145<form action="<?php echo esc_url( $form_post ) ?>" method="post">
    11431146<div id="request-filesystem-credentials-form" class="request-filesystem-credentials-form">
    1144 <h3 id="request-filesystem-credentials-title"><?php _e( 'Connection Information' ) ?></h3>
     1147<?php
     1148// Print a H1 heading in the FTP credentials modal dialog, default is a H2.
     1149$heading_tag = 'h2';
     1150if ( 'plugins.php' === $pagenow || 'plugin-install.php' === $pagenow ) {
     1151    $heading_tag = 'h1';
     1152}
     1153echo "<$heading_tag id='request-filesystem-credentials-title'>" . __( 'Connection Information' ) . "</$heading_tag>";
     1154?>
    11451155<p id="request-filesystem-credentials-desc"><?php
    11461156    $label_user = __('Username');
     
    11801190</div>
    11811191<?php if ( isset($types['ssh']) ) : ?>
    1182 <h4><?php _e('Authentication Keys') ?></h4>
     1192<fieldset>
     1193<legend><?php _e( 'Authentication Keys' ); ?></legend>
    11831194<label for="public_key">
    11841195    <span class="field-title"><?php _e('Public Key:') ?></span>
     
    11891200    <input name="private_key" type="text" id="private_key" value="<?php echo esc_attr($private_key) ?>"<?php disabled( defined('FTP_PRIKEY') ); ?> />
    11901201</label>
     1202</fieldset>
    11911203<span id="auth-keys-desc"><?php _e('Enter the location on the server where the public and private keys are located. If a passphrase is needed, enter that in the password field above.') ?></span>
    11921204<?php endif; ?>
    1193 <h4><?php _e('Connection Type') ?></h4>
    1194 <fieldset><legend class="screen-reader-text"><span><?php _e('Connection Type') ?></span></legend>
     1205<fieldset>
     1206<legend><?php _e( 'Connection Type' ); ?></legend>
    11951207<?php
    11961208    $disabled = disabled( (defined('FTP_SSL') && FTP_SSL) || (defined('FTP_SSH') && FTP_SSH), true, false );
Note: See TracChangeset for help on using the changeset viewer.