Title: WP SoftLinks
Author: SwiftWeb
Published: <strong>Òkúdù 13, 2014</strong>
Last modified: Òkúdù 13, 2014

---

Ṣàwárí àwọn plugin

Plugin yìí **kò tíì ṣe àyẹ̀wò pẹ̀lú àwọn ìtújáde mẹ́ta pàtàkì tó kẹ́yìn ti WordPress**.
Ó lè jẹ́ pé a kò tọ́jú tàbí ṣe àtìlẹ́yìn fún un mọ́, ó sì lè ní àwọn ọ̀ràn ìbámu
nígbà tí a bá lò ó pẹ̀lú àwọn ẹ̀yà WordPress tuntun.

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

# WP SoftLinks

 Láti ọwọ́ [SwiftWeb](https://profiles.wordpress.org/swiftweb/)

[Ṣe ìgbàsílẹ̀](https://downloads.wordpress.org/plugin/wp-softlinks.1.0.1.zip)

 * [Àwọn àlàyé](https://yor.wordpress.org/plugins/wp-softlinks/#description)
 * [Àwọn àgbéyẹ̀wò](https://yor.wordpress.org/plugins/wp-softlinks/#reviews)
 *  [Ìgbéwọlẹ̀](https://yor.wordpress.org/plugins/wp-softlinks/#installation)
 * [Ìdàgbàsókè](https://yor.wordpress.org/plugins/wp-softlinks/#developers)

 [Ìrànlọ́wọ́](https://wordpress.org/support/plugin/wp-softlinks/)

## Àpèjúwe

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" />`

## Àwọn àwòrán ìbòjú

 * [[
 * An example how a link 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 link modal contains an ID field

## Ìgbéwọlẹ̀

 1. Upload the `wp-softlinks` folder to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Place `data-wp-id="1234"` in any HTML tag of your choice.

## FAQ

  How does it work?

The plugin has a hook on the_content that parses the content. Every HTML tag that
contains a data-wp-id, will be converted in a perfect link or source.

  How does it work under the hood?

The plugin uses the DOMDocument Class in PHP to parse the HTML. Tags will be replaced
and removed, and clean HTML will be outputted. So no Javascript or whatsoever.

  Do I have to add the data-wp-id tag manually?

You can, but it will be inserted automatically by the Plugin, when inserting an 
Image or Link in the WordPress editor.

  Can you give me an example?

Sure, you add a data-wp-id to an image: `<img src="#" data-wp-id="24" class="size-
thumbnail" />`, it will be converted to a clean URL: `<img src="http://www.example.
com/media/2014/05/example-150x150.jpg" class="size-thumbnail" />`

  Can I use this with HTTPS?

Yes, because the plugin uses the WordPress Site URL to generate a link.

  Can I use it with any HTML tag?

Sure, you can use any HTML tag, and it recognizes automatically if the tag needs
a `src=""` or `href=""`

  How does it work with image sizes?

WordPress adds a class to any image size (e.g. size-thumbnail). The plugin recognizes
this class and will return the correct link.

  Can I use it in my plugins and themes?

Currently not, but we are working on that.

## Àwọn àgbéyẹ̀wò

Kò sí àwọn àgbéyẹ̀wò fún plugin yìí.

## Àwọn Olùkópa & Olùgbéejáde

“WP SoftLinks” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí ti ṣe ìkópa
sí plugin yìí.

Àwọn Olùkópa

 *   [ SwiftWeb ](https://profiles.wordpress.org/swiftweb/)

[Túmọ̀ “WP SoftLinks” sí èdè rẹ.](https://translate.wordpress.org/projects/wp-plugins/wp-softlinks)

### Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?

[Ṣàwárí koodu](https://plugins.trac.wordpress.org/browser/wp-softlinks/), ṣàyẹ̀wò
[ibi ìpamọ́ SVN](https://plugins.svn.wordpress.org/wp-softlinks/), tàbí ṣe àgbékalẹ̀
sí [àkọsílẹ̀ ìdàgbàsókè](https://plugins.trac.wordpress.org/log/wp-softlinks/) nípasẹ̀
[RSS](https://plugins.trac.wordpress.org/log/wp-softlinks/?limit=100&mode=stop_on_copy&format=rss).

## Àkọsílẹ̀ àwọn àyípadà

#### 1.0.1

Fixed screenshots, improved readme.txt

#### 1.0

Fixed data-wp-id tag in stead of shortcode.

## Àkójọpọ̀ Meta

 *  Ẹ̀yà **1.0.1**
 *  Ìgbàgbọ́hùn tó kẹ́yìn **ọdún 12 sẹ́yìn**
 *  Àwọn ìgbéwọlẹ̀ tó ṣiṣẹ́ **10+**
 *  Ẹ̀yà WordPress ** 3.6 tàbí ju bẹ́ẹ̀ lọ **
 *  Dánwò dé **3.9.40**
 *  Èdè
 * [English (US)](https://wordpress.org/plugins/wp-softlinks/)
 * Àmì
 * [tinyMCE](https://yor.wordpress.org/plugins/tags/tinymce/)
 *  [Ìwòye Tó Péye](https://yor.wordpress.org/plugins/wp-softlinks/advanced/)

## Àwọn ìbò

 5 lára àwọn ìràwọ̀ 5.

 *  [  2 5-star reviews     ](https://wordpress.org/support/plugin/wp-softlinks/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/wp-softlinks/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/wp-softlinks/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/wp-softlinks/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/wp-softlinks/reviews/?filter=1)

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

[See all reviews](https://wordpress.org/support/plugin/wp-softlinks/reviews/)

## Àwọn Olùkópa

 *   [ SwiftWeb ](https://profiles.wordpress.org/swiftweb/)

## Ìrànlọ́wọ́

Nǹkan wà tí o fẹ́ sọ? Ṣé o nílò ìrànlọ́wọ́?

 [Wo àpéjọ ìrànlọ́wọ́](https://wordpress.org/support/plugin/wp-softlinks/)

## Ṣe ìtọrẹ

Ṣé o fẹ́ ṣe àtìlẹ́yìn fún ìlọsíwájú plugin yìí?

 [ Ṣe ìtọrẹ sí plugin yìí ](http://www.swiftweb.nl/)