From f2b5b56ea53f22566bd4d61a5aa93c3251d0bbd2 Mon Sep 17 00:00:00 2001
From: S H Mohanjith <moha@mohanjith.net>
Date: Wed, 4 Dec 2013 23:02:22 +0200
Subject: [PATCH] Change WP_CONTENT_URL if using SSL
---
wp-includes/default-constants.php | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/wp-includes/default-constants.php b/wp-includes/default-constants.php
index 4f135c8..51dc5ce 100644
a
|
b
|
function wp_initial_constants() { |
97 | 97 | * @since 3.0.0 |
98 | 98 | */ |
99 | 99 | function wp_plugin_directory_constants() { |
100 | | if ( !defined('WP_CONTENT_URL') ) |
101 | | define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up |
| 100 | if ( !defined('WP_CONTENT_URL') ) { |
| 101 | if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { |
| 102 | define( 'WP_CONTENT_URL', preg_replace( '/^http:/', 'https:' , get_option('siteurl') ) . '/wp-content' ); // full url - WP_CONTENT_DIR is defined further up with http: replaced by https: |
| 103 | } else { |
| 104 | define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up |
| 105 | } |
| 106 | } |
102 | 107 | |
103 | 108 | /** |
104 | 109 | * Allows for the plugins directory to be moved from the default location. |