wp/wp-admin/options-media.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
     5  * @package WordPress
     5  * @package WordPress
     6  * @subpackage Administration
     6  * @subpackage Administration
     7  */
     7  */
     8 
     8 
     9 /** WordPress Administration Bootstrap */
     9 /** WordPress Administration Bootstrap */
    10 require_once( dirname( __FILE__ ) . '/admin.php' );
    10 require_once __DIR__ . '/admin.php';
    11 
    11 
    12 if ( ! current_user_can( 'manage_options' ) ) {
    12 if ( ! current_user_can( 'manage_options' ) ) {
    13 	wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
    13 	wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
    14 }
    14 }
    15 
    15 
    32 	)
    32 	)
    33 );
    33 );
    34 
    34 
    35 get_current_screen()->set_help_sidebar(
    35 get_current_screen()->set_help_sidebar(
    36 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    36 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    37 	'<p>' . __( '<a href="https://codex.wordpress.org/Settings_Media_Screen">Documentation on Media Settings</a>' ) . '</p>' .
    37 	'<p>' . __( '<a href="https://wordpress.org/support/article/settings-media-screen/">Documentation on Media Settings</a>' ) . '</p>' .
    38 	'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
    38 	'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
    39 );
    39 );
    40 
    40 
    41 include( ABSPATH . 'wp-admin/admin-header.php' );
    41 require_once ABSPATH . 'wp-admin/admin-header.php';
    42 
    42 
    43 ?>
    43 ?>
    44 
    44 
    45 <div class="wrap">
    45 <div class="wrap">
    46 <h1><?php echo esc_html( $title ); ?></h1>
    46 <h1><?php echo esc_html( $title ); ?></h1>
   105 
   105 
   106 <?php if ( ! is_multisite() ) : ?>
   106 <?php if ( ! is_multisite() ) : ?>
   107 <h2 class="title"><?php _e( 'Uploading Files' ); ?></h2>
   107 <h2 class="title"><?php _e( 'Uploading Files' ); ?></h2>
   108 <table class="form-table" role="presentation">
   108 <table class="form-table" role="presentation">
   109 	<?php
   109 	<?php
   110 	// If upload_url_path is not the default (empty), and upload_path is not the default ('wp-content/uploads' or empty)
   110 	/*
       
   111 	 * If upload_url_path is not the default (empty),
       
   112 	 * or upload_path is not the default ('wp-content/uploads' or empty),
       
   113 	 * they can be edited, otherwise they're locked.
       
   114 	 */
   111 	if ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) :
   115 	if ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) :
   112 		?>
   116 		?>
   113 <tr>
   117 <tr>
   114 <th scope="row"><label for="upload_path"><?php _e( 'Store uploads in this folder' ); ?></label></th>
   118 <th scope="row"><label for="upload_path"><?php _e( 'Store uploads in this folder' ); ?></label></th>
   115 <td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr( get_option( 'upload_path' ) ); ?>" class="regular-text code" />
   119 <td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr( get_option( 'upload_path' ) ); ?>" class="regular-text code" />
   151 
   155 
   152 </form>
   156 </form>
   153 
   157 
   154 </div>
   158 </div>
   155 
   159 
   156 <?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
   160 <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>