IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 17 | 17 | |
| 18 | 18 | $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>'; |
| 19 | 19 | |
| 20 | | if ( ! is_multisite() && ( get_option('upload_url_path') || ( get_option('upload_path') != 'wp-content/uploads' && get_option('upload_path') ) ) ) { |
| | 20 | if ( ! is_multisite() && ( get_option('upload_url_path') || ( get_option('upload_path') != WP_CONTENT_DIR_NAME . '/uploads' && get_option('upload_path') ) ) ) { |
| 21 | 21 | $media_options_help .= '<p>' . __('Uploading Files allows you to choose the folder and path for storing your uploaded files.') . '</p>'; |
| 22 | 22 | } |
| 23 | 23 | |
| … |
… |
|
| 100 | 100 | <table class="form-table"> |
| 101 | 101 | <?php |
| 102 | 102 | // If upload_url_path is not the default (empty), and upload_path is not the default ('wp-content/uploads' or empty) |
| 103 | | if ( get_option('upload_url_path') || ( get_option('upload_path') != 'wp-content/uploads' && get_option('upload_path') ) ) : |
| | 103 | if ( get_option('upload_url_path') || ( get_option('upload_path') != WP_CONTENT_DIR_NAME . '/uploads' && get_option('upload_path') ) ) : |
| 104 | 104 | ?> |
| 105 | 105 | <tr> |
| 106 | 106 | <th scope="row"><label for="upload_path"><?php _e('Store uploads in this folder'); ?></label></th> |
| 107 | 107 | <td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr(get_option('upload_path')); ?>" class="regular-text code" /> |
| 108 | 108 | <p class="description"><?php |
| 109 | 109 | /* translators: %s: wp-content/uploads */ |
| 110 | | printf( __( 'Default is %s' ), '<code>wp-content/uploads</code>' ); |
| | 110 | printf( __( 'Default is %s' ), '<code>' . WP_CONTENT_DIR_NAME . '/uploads</code>' ); |
| 111 | 111 | ?></p> |
| 112 | 112 | </td> |
| 113 | 113 | </tr> |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 376 | 376 | __( 'You can find additional plugins for your site by using the <a href="%1$s">Plugin Browser/Installer</a> functionality or by browsing the <a href="%2$s" target="_blank">WordPress Plugin Directory</a> directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your %3$s directory. Once a plugin has been installed, you can activate it here.' ), |
| 377 | 377 | 'plugin-install.php', |
| 378 | 378 | 'https://wordpress.org/plugins/', |
| 379 | | '<code>/wp-content/plugins</code>' |
| | 379 | '<code>/' . WP_CONTENT_DIR_NAME . '/plugins</code>' |
| 380 | 380 | ) . '</p>' |
| 381 | 381 | ) ); |
| 382 | 382 | get_current_screen()->add_help_tab( array( |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 4878 | 4878 | if ( 0 === strpos( $file, $uploads['basedir'] ) ) { |
| 4879 | 4879 | // Replace file location with url location. |
| 4880 | 4880 | $url = str_replace($uploads['basedir'], $uploads['baseurl'], $file); |
| 4881 | | } elseif ( false !== strpos($file, 'wp-content/uploads') ) { |
| 4882 | | $url = $uploads['baseurl'] . substr( $file, strpos($file, 'wp-content/uploads') + 18 ); |
| | 4881 | } elseif ( false !== strpos($file, WP_CONTENT_DIR_NAME . '/uploads') ) { |
| | 4882 | $url = $uploads['baseurl'] . substr( $file, strpos($file, WP_CONTENT_DIR_NAME . '/uploads') + 18 ); |
| 4883 | 4883 | } else { |
| 4884 | 4884 | // It's a newly-uploaded file, therefore $file is relative to the basedir. |
| 4885 | 4885 | $url = $uploads['baseurl'] . "/$file"; |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 116 | 116 | $whitelist_options['media'][] = 'uploads_use_yearmonth_folders'; |
| 117 | 117 | |
| 118 | 118 | // If upload_url_path and upload_path are both default values, they're locked. |
| 119 | | if ( get_option( 'upload_url_path' ) || ( get_option('upload_path') != 'wp-content/uploads' && get_option('upload_path') ) ) { |
| | 119 | if ( get_option( 'upload_url_path' ) || ( get_option('upload_path') != WP_CONTENT_DIR_NAME . '/uploads' && get_option('upload_path') ) ) { |
| 120 | 120 | $whitelist_options['media'][] = 'upload_path'; |
| 121 | 121 | $whitelist_options['media'][] = 'upload_url_path'; |
| 122 | 122 | } |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 65 | 65 | exit; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | | define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); |
| | 68 | define( 'WP_CONTENT_DIR', ABSPATH . WP_CONTENT_DIR_NAME ); |
| 69 | 69 | require_once( ABSPATH . WPINC . '/version.php' ); |
| 70 | 70 | |
| 71 | 71 | wp_check_php_mysql_versions(); |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 2478 | 2478 | |
| 2479 | 2479 | foreach ( $checksums as $file => $checksum ) { |
| 2480 | 2480 | // Skip files which get updated |
| 2481 | | if ( 'wp-content' == substr( $file, 0, 10 ) ) |
| | 2481 | if ( WP_CONTENT_DIR_NAME == substr( $file, 0, 10 ) ) |
| 2482 | 2482 | continue; |
| 2483 | 2483 | if ( ! file_exists( ABSPATH . $file ) || md5_file( ABSPATH . $file ) !== $checksum ) |
| 2484 | 2484 | return false; |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 330 | 330 | define( 'WP_LANG_DIR', WP_CONTENT_DIR . '/languages' ); |
| 331 | 331 | if ( !defined( 'LANGDIR' ) ) { |
| 332 | 332 | // Old static relative path maintained for limited backwards compatibility - won't work in some cases |
| 333 | | define( 'LANGDIR', 'wp-content/languages' ); |
| | 333 | define( 'LANGDIR', WP_CONTENT_DIR_NAME . '/languages' ); |
| 334 | 334 | } |
| 335 | 335 | } else { |
| 336 | 336 | /** |
| … |
… |
|
| 835 | 835 | if ( defined( 'WP_CONTENT_DIR' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) ) |
| 836 | 836 | $locations[] = WP_CONTENT_DIR . '/languages'; |
| 837 | 837 | |
| 838 | | if ( @is_dir( ABSPATH . 'wp-content/languages' ) ) |
| 839 | | $locations[] = ABSPATH . 'wp-content/languages'; |
| | 838 | if ( @is_dir( ABSPATH . WP_CONTENT_DIR_NAME . '/languages' ) ) |
| | 839 | $locations[] = ABSPATH . WP_CONTENT_DIR_NAME . '/languages'; |
| 840 | 840 | |
| 841 | 841 | if ( @is_dir( ABSPATH . WPINC . '/languages' ) ) |
| 842 | 842 | $locations[] = ABSPATH . WPINC . '/languages'; |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 28 | 28 | |
| 29 | 29 | // Base uploads dir relative to ABSPATH |
| 30 | 30 | if ( !defined( 'UPLOADBLOGSDIR' ) ) |
| 31 | | define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' ); |
| | 31 | define( 'UPLOADBLOGSDIR', WP_CONTENT_DIR_NAME . '/blogs.dir' ); |
| 32 | 32 | |
| 33 | 33 | // Note, the main site in a post-MU network uses wp-content/uploads. |
| 34 | 34 | // This is handled in wp_upload_dir() by ignoring UPLOADS for this case. |
| … |
… |
|
| 36 | 36 | define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" ); |
| 37 | 37 | |
| 38 | 38 | // Uploads dir relative to ABSPATH |
| 39 | | if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) |
| | 39 | if ( WP_CONTENT_DIR_NAME . '/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) |
| 40 | 40 | define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" ); |
| 41 | 41 | } |
| 42 | 42 | } |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 880 | 880 | |
| 881 | 881 | // Don't copy wp-content, we'll deal with that below |
| 882 | 882 | // We also copy version.php last so failed updates report their old version |
| 883 | | $skip = array( 'wp-content', 'wp-includes/version.php' ); |
| | 883 | $skip = array( WP_CONTENT_DIR_NAME, 'wp-includes/version.php' ); |
| 884 | 884 | $check_is_writable = array(); |
| 885 | 885 | |
| 886 | 886 | // Check to see which files don't really need updating - only available for 3.7 and higher |
| … |
… |
|
| 893 | 893 | $checksums = $checksums[ $wp_version ]; // Compat code for 3.7-beta2 |
| 894 | 894 | if ( is_array( $checksums ) ) { |
| 895 | 895 | foreach ( $checksums as $file => $checksum ) { |
| 896 | | if ( 'wp-content' == substr( $file, 0, 10 ) ) |
| | 896 | if ( WP_CONTENT_DIR_NAME == substr( $file, 0, 10 ) ) |
| 897 | 897 | continue; |
| 898 | 898 | if ( ! file_exists( ABSPATH . $file ) ) |
| 899 | 899 | continue; |
| … |
… |
|
| 952 | 952 | } |
| 953 | 953 | |
| 954 | 954 | // Check to make sure everything copied correctly, ignoring the contents of wp-content |
| 955 | | $skip = array( 'wp-content' ); |
| | 955 | $skip = array( WP_CONTENT_DIR_NAME ); |
| 956 | 956 | $failed = array(); |
| 957 | 957 | if ( isset( $checksums ) && is_array( $checksums ) ) { |
| 958 | 958 | foreach ( $checksums as $file => $checksum ) { |
| 959 | | if ( 'wp-content' == substr( $file, 0, 10 ) ) |
| | 959 | if ( WP_CONTENT_DIR_NAME == substr( $file, 0, 10 ) ) |
| 960 | 960 | continue; |
| 961 | 961 | if ( ! file_exists( $working_dir_local . $file ) ) |
| 962 | 962 | continue; |
| … |
… |
|
| 989 | 989 | |
| 990 | 990 | // Custom Content Directory needs updating now. |
| 991 | 991 | // Copy Languages |
| 992 | | if ( !is_wp_error($result) && $wp_filesystem->is_dir($from . $distro . 'wp-content/languages') ) { |
| | 992 | if ( !is_wp_error($result) && $wp_filesystem->is_dir($from . $distro . WP_CONTENT_DIR_NAME . '/languages') ) { |
| 993 | 993 | if ( WP_LANG_DIR != ABSPATH . WPINC . '/languages' || @is_dir(WP_LANG_DIR) ) |
| 994 | 994 | $lang_dir = WP_LANG_DIR; |
| 995 | 995 | else |
| … |
… |
|
| 1003 | 1003 | if ( @is_dir($lang_dir) ) { |
| 1004 | 1004 | $wp_lang_dir = $wp_filesystem->find_folder($lang_dir); |
| 1005 | 1005 | if ( $wp_lang_dir ) { |
| 1006 | | $result = copy_dir($from . $distro . 'wp-content/languages/', $wp_lang_dir); |
| | 1006 | $result = copy_dir($from . $distro . WP_CONTENT_DIR_NAME . '/languages/', $wp_lang_dir); |
| 1007 | 1007 | if ( is_wp_error( $result ) ) |
| 1008 | 1008 | $result = new WP_Error( $result->get_error_code() . '_languages', $result->get_error_message(), substr( $result->get_error_data(), strlen( $wp_lang_dir ) ) ); |
| 1009 | 1009 | } |
| … |
… |
|
| 1033 | 1033 | list($type, $filename) = explode('/', $file, 2); |
| 1034 | 1034 | |
| 1035 | 1035 | // Check to see if the bundled items exist before attempting to copy them |
| 1036 | | if ( ! $wp_filesystem->exists( $from . $distro . 'wp-content/' . $file ) ) |
| | 1036 | if ( ! $wp_filesystem->exists( $from . $distro . WP_CONTENT_DIR_NAME . '/' . $file ) ) |
| 1037 | 1037 | continue; |
| 1038 | 1038 | |
| 1039 | 1039 | if ( 'plugins' == $type ) |
| … |
… |
|
| 1047 | 1047 | if ( ! $development_build && $wp_filesystem->exists( $dest . $filename ) ) |
| 1048 | 1048 | continue; |
| 1049 | 1049 | |
| 1050 | | if ( ! $wp_filesystem->copy($from . $distro . 'wp-content/' . $file, $dest . $filename, FS_CHMOD_FILE) ) |
| | 1050 | if ( ! $wp_filesystem->copy($from . $distro . WP_CONTENT_DIR_NAME . '/' . $file, $dest . $filename, FS_CHMOD_FILE) ) |
| 1051 | 1051 | $result = new WP_Error( "copy_failed_for_new_bundled_$type", __( 'Could not copy file.' ), $dest . $filename ); |
| 1052 | 1052 | } else { |
| 1053 | 1053 | if ( ! $development_build && $wp_filesystem->is_dir( $dest . $filename ) ) |
| 1054 | 1054 | continue; |
| 1055 | 1055 | |
| 1056 | 1056 | $wp_filesystem->mkdir($dest . $filename, FS_CHMOD_DIR); |
| 1057 | | $_result = copy_dir( $from . $distro . 'wp-content/' . $file, $dest . $filename); |
| | 1057 | $_result = copy_dir( $from . $distro . WP_CONTENT_DIR_NAME . '/' . $file, $dest . $filename); |
| 1058 | 1058 | |
| 1059 | 1059 | // If a error occurs partway through this final step, keep the error flowing through, but keep process going. |
| 1060 | 1060 | if ( is_wp_error( $_result ) ) { |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 47 | 47 | @ini_set( 'memory_limit', WP_MEMORY_LIMIT ); |
| 48 | 48 | } |
| 49 | 49 | |
| | 50 | if ( !defined('WP_CONTENT_DIR_NAME') ) |
| | 51 | define( 'WP_CONTENT_DIR_NAME', 'wp-content' ); |
| | 52 | |
| 50 | 53 | if ( !defined('WP_CONTENT_DIR') ) |
| 51 | | define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down |
| | 54 | define( 'WP_CONTENT_DIR', ABSPATH . WP_CONTENT_DIR_NAME ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down |
| 52 | 55 | |
| 53 | 56 | // Add define('WP_DEBUG', true); to wp-config.php to enable display of notices during development. |
| 54 | 57 | if ( !defined('WP_DEBUG') ) |
| … |
… |
|
| 132 | 135 | */ |
| 133 | 136 | function wp_plugin_directory_constants() { |
| 134 | 137 | if ( !defined('WP_CONTENT_URL') ) |
| 135 | | define( 'WP_CONTENT_URL', site_url() . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up |
| | 138 | define( 'WP_CONTENT_URL', site_url() . '/' . WP_CONTENT_DIR_NAME); // full url - WP_CONTENT_DIR is defined further up |
| 136 | 139 | |
| 137 | 140 | /** |
| 138 | 141 | * Allows for the plugins directory to be moved from the default location. |
| … |
… |
|
| 157 | 160 | * @deprecated |
| 158 | 161 | */ |
| 159 | 162 | if ( !defined('PLUGINDIR') ) |
| 160 | | define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat. |
| | 163 | define( 'PLUGINDIR', WP_CONTENT_DIR_NAME . '/plugins' ); // Relative to ABSPATH. For back compat. |
| 161 | 164 | |
| 162 | 165 | /** |
| 163 | 166 | * Allows for the mu-plugins directory to be moved from the default location. |
| … |
… |
|
| 182 | 185 | * @deprecated |
| 183 | 186 | */ |
| 184 | 187 | if ( !defined( 'MUPLUGINDIR' ) ) |
| 185 | | define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat. |
| | 188 | define( 'MUPLUGINDIR', WP_CONTENT_DIR_NAME . '/mu-plugins' ); // Relative to ABSPATH. For back compat. |
| 186 | 189 | } |
| 187 | 190 | |
| 188 | 191 | /** |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 215 | 215 | <?php |
| 216 | 216 | endif; |
| 217 | 217 | |
| 218 | | if ( WP_CONTENT_DIR != ABSPATH . 'wp-content' && ( allow_subdirectory_install() || ! allow_subdomain_install() ) ) |
| | 218 | if ( WP_CONTENT_DIR != ABSPATH . WP_CONTENT_DIR_NAME && ( allow_subdirectory_install() || ! allow_subdomain_install() ) ) |
| 219 | 219 | echo '<div class="error inline"><p><strong>' . __('Warning!') . '</strong> ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</p></div>'; |
| 220 | 220 | |
| 221 | 221 | $is_www = ( 0 === strpos( $hostname, 'www.' ) ); |
| … |
… |
|
| 522 | 522 | '<code>' . $home_path . '</code>' |
| 523 | 523 | ); |
| 524 | 524 | echo '</p>'; |
| 525 | | if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) |
| | 525 | if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . WP_CONTENT_DIR_NAME ) |
| 526 | 526 | echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>'; |
| 527 | 527 | ?> |
| 528 | 528 | <textarea class="code" readonly="readonly" cols="100" rows="20"><?php echo esc_textarea( $web_config_file ); ?> |
| … |
… |
|
| 562 | 562 | '<code>' . $home_path . '</code>' |
| 563 | 563 | ); |
| 564 | 564 | echo '</p>'; |
| 565 | | if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) |
| | 565 | if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . WP_CONTENT_DIR_NAME ) |
| 566 | 566 | echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>'; |
| 567 | 567 | ?> |
| 568 | 568 | <textarea class="code" readonly="readonly" cols="100" rows="<?php echo substr_count( $htaccess_file, "\n" ) + 1; ?>"> |
| | 569 | No newline at end of file |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 1813 | 1813 | $siteurl = get_option( 'siteurl' ); |
| 1814 | 1814 | $upload_path = trim( get_option( 'upload_path' ) ); |
| 1815 | 1815 | |
| 1816 | | if ( empty( $upload_path ) || 'wp-content/uploads' == $upload_path ) { |
| | 1816 | if ( empty( $upload_path ) || WP_CONTENT_DIR_NAME . '/uploads' == $upload_path ) { |
| 1817 | 1817 | $dir = WP_CONTENT_DIR . '/uploads'; |
| 1818 | 1818 | } elseif ( 0 !== strpos( $upload_path, ABSPATH ) ) { |
| 1819 | 1819 | // $dir is absolute, $upload_path is (maybe) relative to ABSPATH |
| … |
… |
|
| 1823 | 1823 | } |
| 1824 | 1824 | |
| 1825 | 1825 | if ( !$url = get_option( 'upload_url_path' ) ) { |
| 1826 | | if ( empty($upload_path) || ( 'wp-content/uploads' == $upload_path ) || ( $upload_path == $dir ) ) |
| | 1826 | if ( empty($upload_path) || ( WP_CONTENT_DIR_NAME . '/uploads' == $upload_path ) || ( $upload_path == $dir ) ) |
| 1827 | 1827 | $url = WP_CONTENT_URL . '/uploads'; |
| 1828 | 1828 | else |
| 1829 | 1829 | $url = trailingslashit( $siteurl ) . $upload_path; |