XPressME Integration Kit

Trac


Ignore:
Timestamp:
Nov 24, 2009, 3:49:32 PM (14 years ago)
Author:
toemon
Message:

WordPressの一般設定の「ブログのアドレス (URL)」を変更できるようにした。
但し、アクセスが可能URLなURLでない場合は、インデックスページ呼び出し時に修正が行われる。
fixes #249

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/functions_for_wp_old.php

    r378 r454  
    190190 
    191191endif;  // Under WP2.5 
     192 
     193// Under WP2.7 
     194if (version_compare($xoops_config->wp_version,'2.6', '<')) : 
     195        /** 
     196         * Guess the URL for the site. 
     197         * 
     198         * Will remove wp-admin links to retrieve only return URLs not in the wp-admin 
     199         * directory. 
     200         * 
     201         * @since 2.6.0 
     202         * 
     203         * @return string 
     204         */ 
     205        function wp_guess_url() { 
     206        if ( defined('WP_SITEURL') && '' != WP_SITEURL ) { 
     207                $url = WP_SITEURL; 
     208        } else { 
     209                $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; 
     210                $url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 
     211        } 
     212        return $url; 
     213} 
     214endif;  // Under WP2.6 
    192215 
    193216// Under WP2.7 
Note: See TracChangeset for help on using the changeset viewer.