mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
git-svn-id: http://svn.automattic.com/wordpress/trunk@8182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c64c4fbd63
commit
ce2ed91698
@ -153,9 +153,8 @@ CREATE TABLE $wpdb->usermeta (
|
||||
|
||||
function populate_options() {
|
||||
global $wpdb, $wp_db_version;
|
||||
|
||||
$schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
|
||||
$guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
||||
|
||||
$guessurl = wp_guess_url();
|
||||
|
||||
do_action('populate_options');
|
||||
|
||||
|
@ -21,12 +21,7 @@ function wp_install($blog_title, $user_name, $user_email, $public, $remote) {
|
||||
update_option('enable_app',$remote);
|
||||
update_option('enable_xmlrpc',$remote);
|
||||
|
||||
$schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
|
||||
|
||||
if ( defined('WP_SITEURL') && '' != WP_SITEURL )
|
||||
$guessurl = WP_SITEURL;
|
||||
else
|
||||
$guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
||||
$guessurl = wp_guess_url();
|
||||
|
||||
update_option('siteurl', $guessurl);
|
||||
|
||||
|
@ -2126,4 +2126,14 @@ function force_ssl_admin($force = '') {
|
||||
return $forced;
|
||||
}
|
||||
|
||||
function wp_guess_url() {
|
||||
if ( defined('WP_SITEURL') && '' != WP_SITEURL ) {
|
||||
$url = WP_SITEURL;
|
||||
} else {
|
||||
$schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
|
||||
$url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -7,7 +7,9 @@ require( ABSPATH . WPINC . '/class.wp-styles.php' );
|
||||
require( ABSPATH . WPINC . '/functions.wp-styles.php' );
|
||||
|
||||
function wp_default_scripts( &$scripts ) {
|
||||
$scripts->base_url = site_url();
|
||||
if (!$guessurl = site_url())
|
||||
$guessurl = wp_guess_url();
|
||||
$scripts->base_url = $guessurl;
|
||||
$scripts->default_version = get_bloginfo( 'version' );
|
||||
|
||||
$scripts->add( 'common', '/wp-admin/js/common.js', array('jquery'), '20080318' );
|
||||
@ -203,7 +205,9 @@ function wp_default_scripts( &$scripts ) {
|
||||
}
|
||||
|
||||
function wp_default_styles( &$styles ) {
|
||||
$styles->base_url = site_url();
|
||||
if (!$guessurl = site_url())
|
||||
$guessurl = wp_guess_url();
|
||||
$styles->base_url = $guessurl;
|
||||
$styles->default_version = get_bloginfo( 'version' );
|
||||
$styles->text_direction = 'rtl' == get_bloginfo( 'text_direction' ) ? 'rtl' : 'ltr';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user