Ticket #10970: 10970-readonly.diff
File 10970-readonly.diff, 3.9 KB (added by , 20 months ago) |
---|
-
src/wp-admin/options-general.php
28 28 '<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>'; 29 29 30 30 if ( ! is_multisite() ) { 31 $options_help .= '<p>' . __( 'The WordPress URL and the site URL can be the same (example.com) or different; for example, having the WordPress core files (example.com/wordpress) in a subdirectory instead of the root directory.' ) . '</p>' . 32 '<p>' . __( 'If you want site visitors to be able to register themselves, as opposed to by the site administrator, check the membership box. A default user role can be set for all new users, whether self-registered or registered by the site admin.' ) . '</p>'; 31 if ( ! ( defined( 'WP_DISABLE_URL_CHANGES' ) && WP_DISABLE_URL_CHANGES ) ) { 32 $options_help .= '<p>' . __( 'The WordPress URL and the site URL can be the same (example.com) or different; for example, having the WordPress core files (example.com/wordpress) in a subdirectory instead of the root directory.' ) . '</p>'; 33 } 34 $options_help .= '<p>' . __( 'If you want site visitors to be able to register themselves, as opposed to by the site administrator, check the membership box. A default user role can be set for all new users, whether self-registered or registered by the site admin.' ) . '</p>'; 33 35 } 34 36 35 37 $options_help .= '<p>' . __( 'You can set the language, and the translation files will be automatically downloaded and installed (available if your filesystem is writable).' ) . '</p>' . … … 81 83 </tr> 82 84 83 85 <?php 84 if ( ! is_multisite() ) {86 if ( ! is_multisite() && ! ( defined( 'WP_DISABLE_URL_CHANGES' ) && WP_DISABLE_URL_CHANGES ) ) { 85 87 $wp_site_url_class = ''; 86 88 $wp_home_class = ''; 89 $url_edit_button = ''; 90 // Check wp-config.php for URL settings. 87 91 if ( defined( 'WP_SITEURL' ) ) { 88 $wp_site_url_class = ' disabled';92 $wp_site_url_class = ' readonly'; 89 93 } 90 94 if ( defined( 'WP_HOME' ) ) { 91 $wp_home_class = ' disabled';95 $wp_home_class = ' readonly'; 92 96 } 97 // Enable fields on page load when Change button is clicked or if the constant is set to `false`. 98 if ( empty( $_REQUEST['change_urls'] ) && ! ( defined( 'WP_DISABLE_URL_CHANGES' ) && ! WP_DISABLE_URL_CHANGES ) ) { 99 $wp_site_url_class = ' readonly'; 100 $wp_home_class = ' readonly'; 101 $url_edit_button = ' <a class="button button-secondary aria-button-if-js change-urls" href="options-general.php?change_urls=1">' . __( 'Change site addresses' ) . '</a>'; 102 } 93 103 ?> 94 104 95 105 <tr> 96 106 <th scope="row"><label for="siteurl"><?php _e( 'WordPress Address (URL)' ); ?></label></th> 97 <td><input name="siteurl" type="url" id="siteurl" value="<?php form_option( 'siteurl' ); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php echo $wp_site_url_class; ?>" /></td>107 <td><input name="siteurl" type="url" id="siteurl" value="<?php form_option( 'siteurl' ); ?>"<?php wp_readonly( ! empty( $wp_site_url_class ) ); ?> class="regular-text code<?php echo $wp_site_url_class; ?>" /><?php echo $url_edit_button; ?></td> 98 108 </tr> 99 109 100 110 <tr> 101 111 <th scope="row"><label for="home"><?php _e( 'Site Address (URL)' ); ?></label></th> 102 <td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option( 'home' ); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php echo $wp_home_class; ?>" />112 <td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option( 'home' ); ?>"<?php wp_readonly( ! empty( $wp_home_class ) ); ?> class="regular-text code<?php echo $wp_home_class; ?>" /><?php echo $url_edit_button; ?> 103 113 <?php if ( ! defined( 'WP_HOME' ) ) : ?> 104 114 <p class="description" id="home-description"> 105 115 <?php