[wordpress插件] Any Hostname任何主机名

wordpress 插件 文章 2020-02-19 06:10 833 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

Any Hostname alters all WordPress-generated URLs according to the servers current hostname, so that they will always correspond to the actual hostname as entered by the user, as opposed to always using the URL specified in the WordPress options.

任何主机名都会根据服务器当前的主机名更改所有WordPress生成的URL,因此它们将始终与用户输入的实际主机名相对应,而不是始终使用WordPress选项中指定的URL。

The plugin is ideal for making a site available across multiple domains or running local development servers.

该插件是使站点可跨多个域访问或运行本地开发服务器的理想选择。

Known Issues

已知问题

This plugin will not be able to alter the contents of constants such as WP_CONTENT_URL and WP_PLUGIN_URL as these are (quite naturally) defined before any plugins are loaded.

此插件将无法更改诸如 WP_CONTENT_URL WP_PLUGIN_URL 之类的常量的内容,因为这些(自然而然)是在加载任何插件之前定义的。

Plugin developers should instead rely on either one of the plugins_url(), content_url() or get_option() functions, which will always return the filtered

插件开发人员应改为依赖 plugins_url() content_url() get_option()函数之一,这些函数将始终返回已过滤的

hostname.

主机名。

An example of this is the WPtouch plugin, in which case you can override WPtouch’s compat_get_wp_content_url function, as described by this Gist: https://gist.github.com/1401269.

WPtouch插件就是一个例子,在这种情况下,您可以覆盖WPtouch的 compat_get_wp_content_url 函数,如以下要点所述:https://gist.github.com/1401269。

Any Hostname might also obscure the value of WordPress and Site URL settings on the Options » General settings page, due to the fact that these values are retrieved using the get_option() function.

由于使用 get_option()函数检索这些值,因此任何主机名也可能会混淆“选项”»“常规设置”页面上WordPress和站点URL设置的值。

The values actually stored in WordPress’ database is in fact your site’s true URL.

实际上存储在WordPress数据库中的值实际上是您网站的真实URL。

From 1.0b2 up the plugin will deactivate the host filters on this page, which might cause some page resources to load from the default URL (potentially being unreachable).

从1.0b2开始,该插件将停用此页面上的主机过滤器,这可能会导致某些页面资源从默认URL加载(可能无法访问)。

Any Hostname will not work on WordPress Network sites (WPMU) due to the fact that the pages in a network install stores its URLs explicitily in the database.

由于网络安装中的页面将其URL明确存储在数据库中,因此任何主机名在WordPress网络站点(WPMU)上均不起作用。

Any ideas on how to circumvent this would be greatly appreciated.

任何有关如何避免这种情况的想法将不胜感激。

Due to a bug in the WordPress Settings API (https://core.trac.wordpress.org/ticket/9296) the plugin settings are located on the Privacy page on WordPress versions below 3.5.

由于WordPress设置API(https://core.trac.wordpress.org/ticket/9296)中的错误,插件设置位于WordPress版本低于3.5的“隐私”页面上。

From 3.5 and up the settings can be found on the Permalinks page.

从3.5及更高版本开始,可以在“永久链接”页面上找到设置。

Filters

过滤器

Any Hostname has two filters, allowing you to programatically override the filtered hostname or the list of allowed hostnames.

任何主机名都有两个过滤器,可让您以编程方式覆盖过滤后的主机名或允许的主机名列表。

These are described below.

这些在下面说明。

`any_hostname_host`

`any_hostname_host`

    • Arguments: $host (required)
    • 参数: $ host (必需)

    • Return value: $host (required)
    • 返回值: $ host (必需)

    Takes a host as argument, and returns a host that will be used when substituting the domain in URLs supplied by WordPress.

    以主机作为参数,并返回在将域替换为WordPress提供的URL时将使用的主机。

    This filter can be used to make the plugin use a specific host under certain circumstances.

    在某些情况下,可以使用此过滤器使插件使用特定的主机。

    `any_hostname_allowed_hosts`

    `any_hostname_allowed_hosts`

      • Arguments: $hosts (required)
      • 参数: $ hosts (必需)

      • Return value: $hosts (required)
      • 返回值: $ hosts (必需)

      Takes an array of allowed hosts as argument, and returns an array of hosts to be used when checking if the user specified host should be allowed.

      以允许的主机数组作为参数,并在检查是否应允许用户指定的主机时返回要使用的主机数组。

      Hosts should be treated as regular expression patterns.

      宿主应被视为正则表达式模式。

      Credits

      积分

安装步骤

This section describes how to install the plugin and get it working.

本节介绍如何安装插件并使其正常工作。

    1. Upload the any-hostname directory to the /wp-content/plugins/ directory
    2. any-hostname 目录上传到 / wp-content / plugins / 目录

    3. Activate the plugin through the ‘Plugins’ menu in WordPress
    4. 通过WordPress中的“插件”菜单激活插件

    5. Optionally edit the list of allowed hosts under ‘Options’ » ‘General’ (Privacy for WordPress versions below 3.5)
    6. (可选)在“选项”»“常规”(WordPress版本低于3.5的隐私权)下编辑允许的主机列表。

下载地址
https://downloads.wordpress.org/plugin/any-hostname.1.0.6.zip
-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
[wordpress插件] Advanced Password Security先进的密码安全性
[wordpress插件] Allow Accents and Special Characters in Permalinks永久链接中允许重音符号和特殊字符
[wordpress插件] Disable Comments on Post Categories禁用帖子类别评论
[wordpress插件] DramatarDramatar
[wordpress插件] CleverPush聪明推
随便看看
怎么添加小程序支付功能? 4516
教育科技公司申请微信支付被拒绝? 4799
微信公众号免300认证教程 5892
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5299
小程序广告组件通过审核,但是小程序内没有显示广告? 5067
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9568
问题? 9048
如何快速搭建抽奖助手小程序(无需代码知识) 6177
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 7472
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 6793