Edit File by line
/home/barbar84/www/wp-admin
File: options-media.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Media settings administration panel.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
/** WordPress Administration Bootstrap */
[8] Fix | Delete
require_once __DIR__ . '/admin.php';
[9] Fix | Delete
[10] Fix | Delete
if ( ! current_user_can( 'manage_options' ) ) {
[11] Fix | Delete
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
$title = __( 'Media Settings' );
[15] Fix | Delete
$parent_file = 'options-general.php';
[16] Fix | Delete
[17] Fix | Delete
$media_options_help = '<p>' . __( 'You can set maximum sizes for images inserted into your written content; you can also insert an image as Full Size.' ) . '</p>';
[18] Fix | Delete
[19] Fix | Delete
if ( ! is_multisite() && ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) ) {
[20] Fix | Delete
$media_options_help .= '<p>' . __( 'Uploading Files allows you to choose the folder and path for storing your uploaded files.' ) . '</p>';
[21] Fix | Delete
}
[22] Fix | Delete
[23] Fix | Delete
$media_options_help .= '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>';
[24] Fix | Delete
[25] Fix | Delete
get_current_screen()->add_help_tab(
[26] Fix | Delete
array(
[27] Fix | Delete
'id' => 'overview',
[28] Fix | Delete
'title' => __( 'Overview' ),
[29] Fix | Delete
'content' => $media_options_help,
[30] Fix | Delete
)
[31] Fix | Delete
);
[32] Fix | Delete
[33] Fix | Delete
get_current_screen()->set_help_sidebar(
[34] Fix | Delete
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
[35] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/article/settings-media-screen/">Documentation on Media Settings</a>' ) . '</p>' .
[36] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
[37] Fix | Delete
);
[38] Fix | Delete
[39] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[40] Fix | Delete
[41] Fix | Delete
?>
[42] Fix | Delete
[43] Fix | Delete
<div class="wrap">
[44] Fix | Delete
<h1><?php echo esc_html( $title ); ?></h1>
[45] Fix | Delete
[46] Fix | Delete
<form action="options.php" method="post">
[47] Fix | Delete
<?php settings_fields( 'media' ); ?>
[48] Fix | Delete
[49] Fix | Delete
<h2 class="title"><?php _e( 'Image sizes' ); ?></h2>
[50] Fix | Delete
<p><?php _e( 'The sizes listed below determine the maximum dimensions in pixels to use when adding an image to the Media Library.' ); ?></p>
[51] Fix | Delete
[52] Fix | Delete
<table class="form-table" role="presentation">
[53] Fix | Delete
<tr>
[54] Fix | Delete
<th scope="row"><?php _e( 'Thumbnail size' ); ?></th>
[55] Fix | Delete
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Thumbnail size' ); ?></span></legend>
[56] Fix | Delete
<label for="thumbnail_size_w"><?php _e( 'Width' ); ?></label>
[57] Fix | Delete
<input name="thumbnail_size_w" type="number" step="1" min="0" id="thumbnail_size_w" value="<?php form_option( 'thumbnail_size_w' ); ?>" class="small-text" />
[58] Fix | Delete
<br />
[59] Fix | Delete
<label for="thumbnail_size_h"><?php _e( 'Height' ); ?></label>
[60] Fix | Delete
<input name="thumbnail_size_h" type="number" step="1" min="0" id="thumbnail_size_h" value="<?php form_option( 'thumbnail_size_h' ); ?>" class="small-text" />
[61] Fix | Delete
</fieldset>
[62] Fix | Delete
<input name="thumbnail_crop" type="checkbox" id="thumbnail_crop" value="1" <?php checked( '1', get_option( 'thumbnail_crop' ) ); ?>/>
[63] Fix | Delete
<label for="thumbnail_crop"><?php _e( 'Crop thumbnail to exact dimensions (normally thumbnails are proportional)' ); ?></label>
[64] Fix | Delete
</td>
[65] Fix | Delete
</tr>
[66] Fix | Delete
[67] Fix | Delete
<tr>
[68] Fix | Delete
<th scope="row"><?php _e( 'Medium size' ); ?></th>
[69] Fix | Delete
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Medium size' ); ?></span></legend>
[70] Fix | Delete
<label for="medium_size_w"><?php _e( 'Max Width' ); ?></label>
[71] Fix | Delete
<input name="medium_size_w" type="number" step="1" min="0" id="medium_size_w" value="<?php form_option( 'medium_size_w' ); ?>" class="small-text" />
[72] Fix | Delete
<br />
[73] Fix | Delete
<label for="medium_size_h"><?php _e( 'Max Height' ); ?></label>
[74] Fix | Delete
<input name="medium_size_h" type="number" step="1" min="0" id="medium_size_h" value="<?php form_option( 'medium_size_h' ); ?>" class="small-text" />
[75] Fix | Delete
</fieldset></td>
[76] Fix | Delete
</tr>
[77] Fix | Delete
[78] Fix | Delete
<tr>
[79] Fix | Delete
<th scope="row"><?php _e( 'Large size' ); ?></th>
[80] Fix | Delete
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Large size' ); ?></span></legend>
[81] Fix | Delete
<label for="large_size_w"><?php _e( 'Max Width' ); ?></label>
[82] Fix | Delete
<input name="large_size_w" type="number" step="1" min="0" id="large_size_w" value="<?php form_option( 'large_size_w' ); ?>" class="small-text" />
[83] Fix | Delete
<br />
[84] Fix | Delete
<label for="large_size_h"><?php _e( 'Max Height' ); ?></label>
[85] Fix | Delete
<input name="large_size_h" type="number" step="1" min="0" id="large_size_h" value="<?php form_option( 'large_size_h' ); ?>" class="small-text" />
[86] Fix | Delete
</fieldset></td>
[87] Fix | Delete
</tr>
[88] Fix | Delete
[89] Fix | Delete
<?php do_settings_fields( 'media', 'default' ); ?>
[90] Fix | Delete
</table>
[91] Fix | Delete
[92] Fix | Delete
<?php
[93] Fix | Delete
/**
[94] Fix | Delete
* @global array $wp_settings
[95] Fix | Delete
*/
[96] Fix | Delete
if ( isset( $GLOBALS['wp_settings']['media']['embeds'] ) ) :
[97] Fix | Delete
?>
[98] Fix | Delete
<h2 class="title"><?php _e( 'Embeds' ); ?></h2>
[99] Fix | Delete
<table class="form-table" role="presentation">
[100] Fix | Delete
<?php do_settings_fields( 'media', 'embeds' ); ?>
[101] Fix | Delete
</table>
[102] Fix | Delete
<?php endif; ?>
[103] Fix | Delete
[104] Fix | Delete
<?php if ( ! is_multisite() ) : ?>
[105] Fix | Delete
<h2 class="title"><?php _e( 'Uploading Files' ); ?></h2>
[106] Fix | Delete
<table class="form-table" role="presentation">
[107] Fix | Delete
<?php
[108] Fix | Delete
/*
[109] Fix | Delete
* If upload_url_path is not the default (empty),
[110] Fix | Delete
* or upload_path is not the default ('wp-content/uploads' or empty),
[111] Fix | Delete
* they can be edited, otherwise they're locked.
[112] Fix | Delete
*/
[113] Fix | Delete
if ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) :
[114] Fix | Delete
?>
[115] Fix | Delete
<tr>
[116] Fix | Delete
<th scope="row"><label for="upload_path"><?php _e( 'Store uploads in this folder' ); ?></label></th>
[117] Fix | Delete
<td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr( get_option( 'upload_path' ) ); ?>" class="regular-text code" />
[118] Fix | Delete
<p class="description">
[119] Fix | Delete
<?php
[120] Fix | Delete
/* translators: %s: wp-content/uploads */
[121] Fix | Delete
printf( __( 'Default is %s' ), '<code>wp-content/uploads</code>' );
[122] Fix | Delete
?>
[123] Fix | Delete
</p>
[124] Fix | Delete
</td>
[125] Fix | Delete
</tr>
[126] Fix | Delete
[127] Fix | Delete
<tr>
[128] Fix | Delete
<th scope="row"><label for="upload_url_path"><?php _e( 'Full URL path to files' ); ?></label></th>
[129] Fix | Delete
<td><input name="upload_url_path" type="text" id="upload_url_path" value="<?php echo esc_attr( get_option( 'upload_url_path' ) ); ?>" class="regular-text code" />
[130] Fix | Delete
<p class="description"><?php _e( 'Configuring this is optional. By default, it should be blank.' ); ?></p>
[131] Fix | Delete
</td>
[132] Fix | Delete
</tr>
[133] Fix | Delete
<tr>
[134] Fix | Delete
<td colspan="2" class="td-full">
[135] Fix | Delete
<?php else : ?>
[136] Fix | Delete
<tr>
[137] Fix | Delete
<td class="td-full">
[138] Fix | Delete
<?php endif; ?>
[139] Fix | Delete
<label for="uploads_use_yearmonth_folders">
[140] Fix | Delete
<input name="uploads_use_yearmonth_folders" type="checkbox" id="uploads_use_yearmonth_folders" value="1"<?php checked( '1', get_option( 'uploads_use_yearmonth_folders' ) ); ?> />
[141] Fix | Delete
<?php _e( 'Organize my uploads into month- and year-based folders' ); ?>
[142] Fix | Delete
</label>
[143] Fix | Delete
</td>
[144] Fix | Delete
</tr>
[145] Fix | Delete
[146] Fix | Delete
<?php do_settings_fields( 'media', 'uploads' ); ?>
[147] Fix | Delete
</table>
[148] Fix | Delete
<?php endif; ?>
[149] Fix | Delete
[150] Fix | Delete
<?php do_settings_sections( 'media' ); ?>
[151] Fix | Delete
[152] Fix | Delete
<?php submit_button(); ?>
[153] Fix | Delete
[154] Fix | Delete
</form>
[155] Fix | Delete
[156] Fix | Delete
</div>
[157] Fix | Delete
[158] Fix | Delete
<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>
[159] Fix | Delete
[160] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function