Changeset 14513 for trunk/wp-admin/network.php
- Timestamp:
- 05/08/2010 03:25:33 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/network.php
r14463 r14513 49 49 50 50 return true; 51 } 52 /** 53 * Allow folder install 54 * 55 * @since 3.0.0 56 * @return bool Whether folder install is allowed 57 */ 58 function allow_folder_install() { 59 global $wpdb; 60 if ( apply_filters( 'allow_folder_install', false ) ) 61 return true; 62 63 $post = $wpdb->get_row( "SELECT ID FROM $wpdb->posts WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'" ); 64 if ( empty( $post ) ) 65 return true; 66 67 return false; 51 68 } 52 69 /** … … 109 126 if ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443' ) ) ) ) { 110 127 echo '<div class="error"><p><strong>' . __( 'Error:') . '</strong> ' . __( 'You cannot install a network of sites with your server address.' ) . '</strong></p></div>'; 111 if ( $no_ip ) 112 echo '<p>' . __( 'You cannot use an IP address such as <code>127.0.0.1</code>.' ) . '</p>'; 113 else 114 echo '<p>' . sprintf( __( 'You cannot use port numbers such as <code>%s</code>.' ), $has_ports ) . '</p>'; 128 echo '<p>' . sprintf( __( 'You cannot use port numbers such as <code>%s</code>.' ), $has_ports ) . '</p>'; 115 129 echo '<a href="' . esc_url( admin_url() ) . '">' . __( 'Return to Dashboard' ) . '</a>'; 116 130 include( './admin-footer.php' ); … … 140 154 $subdomain_install = (bool) $_POST['subdomain_install']; 141 155 } elseif ( apache_mod_loaded('mod_rewrite') ) { // assume nothing 156 $subdomain_install = true; 157 } elseif ( !allow_folder_install() ) { 142 158 $subdomain_install = true; 143 159 } else { … … 150 166 } 151 167 152 if ( allow_subdomain_install() ) : ?>168 if ( allow_subdomain_install() && allow_folder_install() ) : ?> 153 169 <h3><?php esc_html_e( 'Addresses of Sites in your Network' ); ?></h3> 154 170 <p><?php _e( 'Please choose whether you would like sites in your WordPress network to use sub-domains or sub-directories. <strong>You cannot change this later.</strong>' ); ?></p> … … 238 254 239 255 if ( $_POST ) { 240 $subdomain_install = allow_subdomain_install() ? ! empty( $_POST['subdomain_install']) : false;256 $subdomain_install = allow_subdomain_install() ? ( allow_folder_install() ? ! empty( $_POST['subdomain_install'] ) : true ) : false; 241 257 } else { 242 258 if ( is_multisite() ) { … … 333 349 </ol> 334 350 <?php if ( !is_multisite() ) { ?> 335 <p><?php printf( __( 'Once you complete these steps, your network is enabled and configured. ') ); ?> <a href="<?php echo esc_url( admin_url() ); ?>"><?php _e( 'Return to Dashboard' ); ?></a></p>351 <p><?php printf( __( 'Once you complete these steps, your network is enabled and configured. You will have to log in again.') ); ?> <a href="<?php echo esc_url( site_url( 'wp-login.php' ) ); ?>"><?php _e( 'Log In' ); ?></a></p> 336 352 <?php 337 353 }
Note: See TracChangeset
for help on using the changeset viewer.