Title: Dynamic Hostname
Author: Takayuki Miyauchi
Published: <strong>2014 年 3 月 18 日</strong>
Last modified: 2015 年 4 月 26 日

---

搜尋外掛

![](https://ps.w.org/dynamic-hostname/assets/banner-772x250.png?rev=877017)

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/dynamic-hostname_1b95bb.svg)

# Dynamic Hostname

 由 [Takayuki Miyauchi](https://profiles.wordpress.org/miyauchi/) 開發

[下載](https://downloads.wordpress.org/plugin/dynamic-hostname.0.4.2.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/dynamic-hostname/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/dynamic-hostname/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/dynamic-hostname/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/dynamic-hostname/#developers)

 [技術支援](https://wordpress.org/support/plugin/dynamic-hostname/)

## 外掛說明

This plugin changes dynamically and automatically the host name which WordPress 
uses. For example, when you run WordPress on your different servers, for production,
development or staging, the host name will be changed dynamically and each site 
won’t have broken links. It’s very useful when you use it with Vagrant Cloud.

#### Some features

 * Temporarily changes the host name to the current host name ($_SERVER[‘HTTP_HOST’]).
 * Also replaces the host name of the links to the contents and the images in the
   same site.
 * The host name included in the contents on the development server will be changed
   to the one for the production server. (You don’t need to replace the host name
   in the database when you move it to the production server.)
 * The host name in the editor window is temporarily replaced with the current host
   name, so when you edit some on the development server, you never have broken 
   links.

#### Hooks to use for replacing

This plugin uses the filter hooks below to replace the host name in URL.

    ```
    $hooks = array(
        "home_url",
        "site_url",
        "stylesheet_directory_uri",
        "template_directory_uri",
        "plugins_url",
        "wp_get_attachment_url",
        "theme_mod_header_image",
        "theme_mod_background_image",
        "the_content",
        "upload_dir",
        "widget_text",
    );
    ```

Those hooks also have their own filter hooks, so you can customize with other plugins
you are using, etc.

    ```
    add_filter('dynamic_hostname_filters' function($hooks){
        $hooks[] = 'some_filter_hook';
        return $hooks;
    });
    ```

## 安裝方式

#### Manual Installation

 1. Upload the entire `/dynamic-hostname` directory to the `/wp-content/plugins/` directory.
 2. Activate through the ‘Plugins’ menu in WordPress.

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Dynamic Hostname〉的開發相關工作。

參與者

 *   [ Takayuki Miyauchi ](https://profiles.wordpress.org/miyauchi/)
 *   [ DigitalCube Inc. ](https://profiles.wordpress.org/megumithemes/)
 *   [ tekapo ](https://profiles.wordpress.org/tekapo/)
 *   [ Takashi Kitajima ](https://profiles.wordpress.org/inc2734/)
 *   [ Toro_Unit (Hiroshi Urabe) ](https://profiles.wordpress.org/toro_unit/)

[將〈Dynamic Hostname〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/dynamic-hostname)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/dynamic-hostname/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/dynamic-hostname/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/dynamic-hostname/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/dynamic-hostname/)。

## 變更記錄

#### 0.4.1

 * Tested up to 4.1

#### 0.1.0

 * First release

## 中繼資料

 *  版本 **0.4.2**
 *  最後更新 **11 年前**
 *  啟用安裝數 **300+**
 *  WordPress 版本需求 ** 3.8 或更新版本 **
 *  已測試相容的 WordPress 版本 **4.2.39**
 *  語言
 * [English (US)](https://wordpress.org/plugins/dynamic-hostname/)
 * 標籤:
 * [hostname](https://tw.wordpress.org/plugins/tags/hostname/)[site_url](https://tw.wordpress.org/plugins/tags/site_url/)
 *  [進階檢視](https://tw.wordpress.org/plugins/dynamic-hostname/advanced/)

## 評分

這個項目尚無任何評論記錄。

[Your review](https://wordpress.org/support/plugin/dynamic-hostname/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/dynamic-hostname/reviews/)

## 參與者

 *   [ Takayuki Miyauchi ](https://profiles.wordpress.org/miyauchi/)
 *   [ DigitalCube Inc. ](https://profiles.wordpress.org/megumithemes/)
 *   [ tekapo ](https://profiles.wordpress.org/tekapo/)
 *   [ Takashi Kitajima ](https://profiles.wordpress.org/inc2734/)
 *   [ Toro_Unit (Hiroshi Urabe) ](https://profiles.wordpress.org/toro_unit/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/dynamic-hostname/)