Make WordPress Core


Ignore:
Timestamp:
05/23/2019 11:34:40 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Networks and Sites: Readjust tabs in wp-admin/includes/network.php for (more or less) consistent alignment.

See #47062.

File:
1 edited

Legend:

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

    r45390 r45391  
    258258        }
    259259
    260                 $is_www = ( 0 === strpos( $hostname, 'www.' ) );
     260        $is_www = ( 0 === strpos( $hostname, 'www.' ) );
    261261        if ( $is_www ) :
    262262                ?>
    … …  
    463463        }
    464464        ?>
    465                 <ol>
    466                         <li><p>
    467                         <?php
    468                         printf(
    469                                 /* translators: 1: wp-config.php, 2: location of wp-config file, 3: translated version of "That's all, stop editing! Happy publishing." */
    470                                 __( 'Add the following to your %1$s file in %2$s <strong>above</strong> the line reading %3$s:' ),
    471                                 '<code>wp-config.php</code>',
    472                                 '<code>' . $location_of_wp_config . '</code>',
    473                                 /*
    474                                 * translators: This string should only be translated if wp-config-sample.php is localized.
    475                                 * You can check the localized release package or
    476                                 * https://i18n.svn.wordpress.org/<locale code>/branches/<wp version>/dist/wp-config-sample.php
    477                                 */
    478                                 '<code>/* ' . __( 'That&#8217;s all, stop editing! Happy publishing.' ) . ' */</code>'
    479                         );
    480                         ?>
    481                         </p>
    482                                 <textarea class="code" readonly="readonly" cols="100" rows="7">
     465        <ol>
     466                <li><p>
     467                <?php
     468                printf(
     469                        /* translators: 1: wp-config.php, 2: location of wp-config file, 3: translated version of "That's all, stop editing! Happy publishing." */
     470                        __( 'Add the following to your %1$s file in %2$s <strong>above</strong> the line reading %3$s:' ),
     471                        '<code>wp-config.php</code>',
     472                        '<code>' . $location_of_wp_config . '</code>',
     473                        /*
     474                        * translators: This string should only be translated if wp-config-sample.php is localized.
     475                        * You can check the localized release package or
     476                        * https://i18n.svn.wordpress.org/<locale code>/branches/<wp version>/dist/wp-config-sample.php
     477                        */
     478                        '<code>/* ' . __( 'That&#8217;s all, stop editing! Happy publishing.' ) . ' */</code>'
     479                );
     480                ?>
     481                </p>
     482                <textarea class="code" readonly="readonly" cols="100" rows="7">
    483483define('MULTISITE', true);
    484484define('SUBDOMAIN_INSTALL', <?php echo $subdomain_install ? 'true' : 'false'; ?>);
    … …  
    488488define('BLOG_ID_CURRENT_SITE', 1);
    489489</textarea>
    490         <?php
    491         $keys_salts = array(
    492                 'AUTH_KEY'         => '',
    493                 'SECURE_AUTH_KEY'  => '',
    494                 'LOGGED_IN_KEY'    => '',
    495                 'NONCE_KEY'        => '',
    496                 'AUTH_SALT'        => '',
    497                 'SECURE_AUTH_SALT' => '',
    498                 'LOGGED_IN_SALT'   => '',
    499                 'NONCE_SALT'       => '',
    500         );
    501         foreach ( $keys_salts as $c => $v ) {
    502                 if ( defined( $c ) ) {
    503                         unset( $keys_salts[ $c ] );
    504                 }
    505         }
    506 
    507         if ( ! empty( $keys_salts ) ) {
    508                 $keys_salts_str = '';
    509                 $from_api       = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );
    510                 if ( is_wp_error( $from_api ) ) {
    511                         foreach ( $keys_salts as $c => $v ) {
    512                                 $keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );";
     490                <?php
     491                $keys_salts = array(
     492                        'AUTH_KEY'         => '',
     493                        'SECURE_AUTH_KEY'  => '',
     494                        'LOGGED_IN_KEY'    => '',
     495                        'NONCE_KEY'        => '',
     496                        'AUTH_SALT'        => '',
     497                        'SECURE_AUTH_SALT' => '',
     498                        'LOGGED_IN_SALT'   => '',
     499                        'NONCE_SALT'       => '',
     500                );
     501                foreach ( $keys_salts as $c => $v ) {
     502                        if ( defined( $c ) ) {
     503                                unset( $keys_salts[ $c ] );
    513504                        }
    514                 } else {
    515                         $from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) );
    516                         foreach ( $keys_salts as $c => $v ) {
    517                                 $keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );";
     505                }
     506
     507                if ( ! empty( $keys_salts ) ) {
     508                        $keys_salts_str = '';
     509                        $from_api       = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );
     510                        if ( is_wp_error( $from_api ) ) {
     511                                foreach ( $keys_salts as $c => $v ) {
     512                                        $keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );";
     513                                }
     514                        } else {
     515                                $from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) );
     516                                foreach ( $keys_salts as $c => $v ) {
     517                                        $keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );";
     518                                }
    518519                        }
    519                 }
    520                 $num_keys_salts = count( $keys_salts );
    521                 ?>
    522 <p>
    523                 <?php
    524                 if ( 1 == $num_keys_salts ) {
    525                         printf(
    526                                 /* translators: %s: wp-config.php */
    527                                 __( 'This unique authentication key is also missing from your %s file.' ),
    528                                 '<code>wp-config.php</code>'
    529                         );
    530                 } else {
    531                         printf(
    532                                 /* translators: %s: wp-config.php */
    533                                 __( 'These unique authentication keys are also missing from your %s file.' ),
    534                                 '<code>wp-config.php</code>'
    535                         );
    536                 }
    537                 ?>
    538                 <?php _e( 'To make your installation more secure, you should also add:' ); ?>
    539         </p>
    540         <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php echo esc_textarea( $keys_salts_str ); ?></textarea>
    541                 <?php
    542         }
    543         ?>
    544 </li>
     520                        $num_keys_salts = count( $keys_salts );
     521                        ?>
     522                <p>
     523                        <?php
     524                        if ( 1 == $num_keys_salts ) {
     525                                printf(
     526                                        /* translators: %s: wp-config.php */
     527                                        __( 'This unique authentication key is also missing from your %s file.' ),
     528                                        '<code>wp-config.php</code>'
     529                                );
     530                        } else {
     531                                printf(
     532                                        /* translators: %s: wp-config.php */
     533                                        __( 'These unique authentication keys are also missing from your %s file.' ),
     534                                        '<code>wp-config.php</code>'
     535                                );
     536                        }
     537                        ?>
     538                        <?php _e( 'To make your installation more secure, you should also add:' ); ?>
     539                </p>
     540                <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php echo esc_textarea( $keys_salts_str ); ?></textarea>
     541                        <?php
     542                }
     543                ?>
     544                </li>
    545545        <?php
    546546        if ( iis7_supports_permalinks() ) :
Note: See TracChangeset for help on using the changeset viewer.