Skip to content

Commit

Permalink
Docs: Correct and clarify an inline comment about the `upload_url_pat…
Browse files Browse the repository at this point in the history
…h` and `upload_path` options in `wp-admin/options-media.php`.

Synchronize it with a similar comment in `wp-admin/options.php`.

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47874 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jun 1, 2020
1 parent bec349c commit e0ede89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/wp-admin/options-media.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@
<h2 class="title"><?php _e( 'Uploading Files' ); ?></h2>
<table class="form-table" role="presentation">
<?php
// If upload_url_path is not the default (empty), and upload_path is not the default ('wp-content/uploads' or empty).
/*
* If upload_url_path is not the default (empty),
* or upload_path is not the default ('wp-content/uploads' or empty),
* they can be edited, otherwise they're locked.
*/
if ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) :
?>
<tr>
Expand Down
6 changes: 5 additions & 1 deletion src/wp-admin/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@

$whitelist_options['media'][] = 'uploads_use_yearmonth_folders';

// If upload_url_path and upload_path are both default values, they're locked.
/*
* If upload_url_path is not the default (empty),
* or upload_path is not the default ('wp-content/uploads' or empty),
* they can be edited, otherwise they're locked.
*/
if ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) {
$whitelist_options['media'][] = 'upload_path';
$whitelist_options['media'][] = 'upload_url_path';
Expand Down

0 comments on commit e0ede89

Please sign in to comment.