跳到内容

WP SoftLinks

v1.0.1

SwiftWeb · 2014年6月13日 上架

This plugin allows you to use a simple HTML tag that dynamically generates href and src tags. Easy to use, and extremely helpful.

正在使用
10+
评分
5.0 / 5
累计下载
1,578
最近更新
2014年6月13日
2 条评价需要 WordPress 3.6+已测试到 3.9.40

贡献者

截图

An example how a link works with the data-wp-id
An example how a link works with the data-wp-id
An example how an image works with the data-wp-id
An example how an image works with the data-wp-id
The image remains intact in the editor
The image remains intact in the editor
The link modal contains an ID field
The link modal contains an ID field

We were tired to alter every link and image in posts, pages or widgets when switching from development to live environments.

e.g. when you insert an image in TinyMCE on your development environment (http://dev.example.com), the image has a hard URL: http://dev.example.com/media/2014/06/example.jpg
When switching to your live environment (http://live.example.com), you change your WordPress Site URL, but the image in the content is still http://dev.example.com/media/2014/06/example.jpg.
This is very frustrating, you have to alter each page, post, widget etcetera…

This plugin solves that problem. It automatically adds a data-wp-id tag when you insert an image or link in your TinyMCE.
The data-wp-id tag contains a unique ID from the wp-post table in WordPress.

When displaying the content on the front-end this plugin automatically recognizes the data-wp-id tag and replaces the src="" and href="" with the correct permalink.
You can use the tag anywhere you want, simply add the data-wp-id="123" (where 123 is the ID).

So, how does it work?

The plugin automatically adds the data-wp-id when inserting an image or link in the WordPress editor.

Normally, when you insert an image into the WP editor, WordPress would generate image tags like this:

<img src="http://dev.example.com/media/2014/05/example-150x150.jpg" class="size-thumbnail" width="150" height="150" />

But this Plugin will generate a link like this:

<img data-wp-id="123" src="#" class="size-thumbnail" width="150" height="150" />

… And finally on the Front-End, the Plugin will output is as:

<img src="http://live.example.com/media/2014/05/example-150x150.jpg" class="size-thumbnail" width="150" height="150" />

Another example, adding a link:

Normally WordPress will generate a link like this:

<a href="http://dev.example.com/example-page" target="_blank" />

But this Plugin will generate it like this:

<a data-wp-id="100" href="#" target="_blank" />

…And finally on the Front-End, the Plugin will output it as:

<a href="http://live.example.com/example-page" target="_blank" />

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums