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

Location:
trunk/xpressme_integration_kit/wp-content/plugins/xpressme
Files:
3 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 
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_common_functions.php

    r452 r454  
    357357} 
    358358 
    359 function safe_site_url_filter($site_url){ 
    360         global $xoops_config; 
    361         if (!$xoops_config->is_wpmu){ 
    362                 if ($site_url != get_xpress_url()) $site_url = get_xpress_url(); 
    363         } 
    364         return $site_url; 
    365 } 
    366  
    367359function get_block_file_path($mydirname,$file_name) 
    368360{ 
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme.php

    r453 r454  
    7171} 
    7272add_action("wp_meta" , "wp_meta_add_xpress_menu");                      // add xpress menu  in wp_meta 
    73          
    74 //Site URL check 
    75 add_filter('option_home',                       "safe_site_url_filter"); 
    76 add_filter('option_siteurl',            "safe_site_url_filter"); 
    77          
    7873 
    7974//XOOPS Bloack Cache Refresh 
Note: See TracChangeset for help on using the changeset viewer.