Title: The Permalinker
Author: Andy Stratton
Published: <strong>2009 年 6 月 30 日</strong>
Last modified: 2024 年 12 月 13 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

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

# The Permalinker

 作者：[Andy Stratton](https://profiles.wordpress.org/theandystratton/)

[下载](https://downloads.wordpress.org/plugin/the-permalinker.1.9.0.zip)

 * [详情](https://cn.wordpress.org/plugins/the-permalinker/#description)
 * [评价](https://cn.wordpress.org/plugins/the-permalinker/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/the-permalinker/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/the-permalinker/#developers)

 [支持](https://wordpress.org/support/plugin/the-permalinker/)

## 描述

Use short codes to dynamically link to your WordPress pages and posts. All you need
is the ID. This can come in handy when developing content for WordPress sites. Makes
for a cleaner migration with no need to manipulate content when moving from one 
subdirectory or domain to another.

Attributes of `append` `class`, `rel`, and `target` are supported within the `[permalink]`
opening tag. See FAQs. You can insert the token `%post_title%` to dynamically insert
the post’s title into anchor text (content between the opening and closing shortcode).

A short code for `[template_uri]` exists if you’d like to dynamically grab the full
URL to your current template directory (useful for adding images and other resources
bundled in a template via the page/post editor).

_Example 1: Create link._

    ```
    [permalink id=2 rel="internal"]Check out my latest post named %post_title%[/permalink] or use `[permalink]this link[/permalink]` to link to this post.
    ```

_Example 2: Output Permalink URL._

    ```
    <a href="[permalink]">;This post.</a>;
    ```

_Example 3: Template Directory URI_

    ```
    <img src="[template_uri]/photos/me_grandma.jpg" alt="A Photo of Me and My Grandma" />
    ```

## 屏幕截图

[⌊Content with short codes.⌉⌊Content with short codes.⌉[

Content with short codes.

[⌊The dynamic output.⌉⌊The dynamic output.⌉[

The dynamic output.

[⌊Markup.⌉⌊Markup.⌉[

Markup.

## 安装

 1. Download and unzip to the ‘wp-content/plugins/’ directory
 2. Activate the plugin.

## 常见问题

### I’ve got multiple permalinker short codes and it’s interpreting them incorrectly and not creating the anchor tags properly. What gives?

It is recommended that if you are mixing non-terminating short codes with terminating
codes, that you change all non-terminating
 short codes into terminating short codes
with whitespace as the content:

    ```
    [permalink] becomes `[permalink] [/permalink]`
    ```

Leading or trailing whitespace is trimmed off of any content within the permalinker
short code tags.

### Can I add a class, rel, or target attribute to the permalinker output?

Yes. Simply add `class`, `rel`, or `target` attributes to the `[permalink]` short
code and they will be added to the resulting anchor element:

    ```
    [permalink id="232" rel="related" target="_blank" class="highlight"]My favorite post[/permalink]
    ```

### Can I append a named anchor/ID/query string to the generated permalink?

Yes! Simply use the new `append` attribute (added in version 1.6):

    ```
    [permalink id="232" append="#comments"]People are talking, talking 'bout people.[/permalink]
    ```

## 评价

此插件暂无评价。

## 贡献者及开发者

「The Permalinker」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Andy Stratton ](https://profiles.wordpress.org/theandystratton/)

[帮助将「The Permalinker」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/the-permalinker)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/the-permalinker/)，查看
[SVN仓库](https://plugins.svn.wordpress.org/the-permalinker/)，或通过[RSS](https://plugins.trac.wordpress.org/log/the-permalinker/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/the-permalinker/)。

## 更新日志

#### 1.9.0

 * Added important security enhancements for escaping URLs and HTML content to prevent
   XSS and other potential security holes
 * Some legacy output may be affected as we are now escaping URLs and HTML attributes.
 * Content inside of the shortcode should _not_ be escaped as we want to preserve
   any HTML within that shortcode content/anchor text.

#### 1.8.0

 * WP 5.6 + PHP 7.4 compatibility
 * Minor code formatting clean up
 * Moved help documentation to Admin > Dashboard menu

#### 1.7.1 (2019-04-28)

 * WP 5.2 compatibility

#### 1.7 (2012-01-06)

 * Added ability to dynamically insert post_title into anchor text using the token%
   post_title%

## 额外信息

 *  版本 **1.9.0**
 *  最后更新：**1 年前**
 *  活跃安装数量 **100+**
 *  WordPress 版本 ** 2.6 或更高版本 **
 *  已测试的最高版本为 **6.4.8**
 *  语言
 * [English (US)](https://wordpress.org/plugins/the-permalinker/)
 * 标签
 * [development](https://cn.wordpress.org/plugins/tags/development/)[linking](https://cn.wordpress.org/plugins/tags/linking/)
   [migration](https://cn.wordpress.org/plugins/tags/migration/)[permalinks](https://cn.wordpress.org/plugins/tags/permalinks/)
   [staging](https://cn.wordpress.org/plugins/tags/staging/)
 *  [高级视图](https://cn.wordpress.org/plugins/the-permalinker/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  2 条 5 星评价     ](https://wordpress.org/support/plugin/the-permalinker/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/the-permalinker/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/the-permalinker/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/the-permalinker/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/the-permalinker/reviews/?filter=1)

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

[查看全部评论](https://wordpress.org/support/plugin/the-permalinker/reviews/)

## 贡献者

 *   [ Andy Stratton ](https://profiles.wordpress.org/theandystratton/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/the-permalinker/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://theandystratton.com/donate)