W4 Internal Link Shortcode

WordPress plugin for putting internal links with shortcode. Support posts link from another blog of same network.

Author:Shazzad Hossain Khan (profile at wordpress.org)
WordPress version required:2.9
WordPress version tested:3.0.5
Plugin version:1.3
Added to WordPress repository:14-12-2010
Last updated:24-12-2010
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:96
Rated by:5
Plugin URI:http://w4dev.com/w4-plugin/w4-internal-link-s...
Total downloads:2 613
plugin download
Click to start download

Now you can easily embed your wordpress sites internal links (of post, page ,category, author) in post content, page content or category description area. Just write the appropriate shortcode, and you are done. No need to update these links whenever you make any changes to the real link location.

Let us know your thought.

Add link from other blog of a network( V.1.3 ) by blog id. use blog_id attribute to do that. This feature only supports for post link with id, not name or slug. Example: [intlink type="post" id="2" blog_id="3"] This will generate link for post id 2 from the blog having id 3.

Upgrade Notice

  • Link to a post from another blog on a multisite network ( V.1.3).
  • New attribute ("target") introduced in Version 1.2. "target" attribute is same as a HTML anchor link target.(Recommend by "Simon")
  • New attribute ("before" and "after") introduced in Version 1.1. These are for putting texts on before or after the link.

Example:

The default category link of your site should look like something http://example.com/category/uncategorized/. A shortcode for displaying this link should be..

[intlink type="cat" slug="uncategorized"]

Now, if you change your category base to cats, like http://example.com/cats/uncategorized/ , you don't have to update the shortcode. It will take the latest format to show the link.

Arguments:

  • blog_id = default 'null'. (Show link from another blog on same network)
  • type = default 'post'. (Your link type:post/page/cat/author).
  • id = default ''. (This is the post/page/author/category id based on the type you have chosen).
  • text = default based on the type. Post/Page title for type 'post' or 'page', Category name for 'cat', author display name for 'author'. ( the text to show inside the link).
  • name = default ''. (Name of the link item object. Ex: "Uncategorized" for category Uncategorized, "Hello world" for the post Hello world).
  • slug = default ''. (Slug of the link item object. Ex: "hello-world" for the post Hello world).
  • class = default 'w4_internal_link'. (A HTML class for the link element "a").
  • before = default ''. (Put text or html element before the link).
  • after = default ''. (Put text or html element after the link).

Notes

  • Remember,you have to write the shortcode properly. Script has a priority for finding a link from your shortcode.
  • Firstly, the script will try to find the link type. if you haven't entered any type in your shortcode, it will assume the link as post/page link.
  • Secondly, it will find your given attribute(id,name,slug) for the link. By priority, it will look for the "id" first. if id not found,then it will look for the "name". And last it will look for the slug.Slug is pretty eiser than name,as it contains all small letter and no space. If the is a name "I love WordPress",the slug should be for this "i-love-wordpress",there is some exception although.
  • Lastly, it will fletch the link based on the matched attribute and its parameter.

Similar attributes and parameters

Attributes: * "tr|Tr|tar|targat|_target|terget|openin|newpage" for target

Parameters: * "p|P|post|posts|page|pages" for "post" * "c|C|cat|cats|category" for "cat" * "a|A|auth|aothor|author" for "author" * "p|parent|own|this|self|no" for target parameter "_parent" * "b|blank|new|another|out|yes" for target parameter "_blank"

-- We have added similar attributes and parameters to give you a result at least. Please try using appropriate attributes and parameters. --

If you are unable to use/manage this plugin or if you have some suggestions to improve this plugin Contact us.