WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't 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.

slink

slink creates named links using a Markdown-like syntax. Named links insert html or php into a page or post, without writing any html or php.

slink provides a way to insert named links into pages and posts, and have those links translated into HTML or execute PHP as defined in a separate configuration file. It uses a Markdown-like syntax that should be understandable by anyone who uses Markdown.

The possibilities of slink are boundless, some example uses are:

  • insert relative links into your posts, and change them any time without editing the posts
  • insert images into your posts, conveniently linked to somewhere outside of WordPress
  • create shorthand for common links
  • include other pages into your posts without writing any PHP
  • execute any PHP you want while the page is being generated by WordPress

slink's intended audience is:

  • WordPress developers who support non-PHP-savvy users that are updating content in WordPress. The content-side syntax is no more difficult than Markdown, so it should be easier for those users than coding name=value pairs as with the WP tag implementation.
  • anybody who wants to create shorthand for commonly used elements in their WordPress content. For instance, the download box on my page, which I use in several places, has the markup defined in the slink_config file, so if I want to change it, I only need to do so in one place.

Version History

0.2

  • fix for bad handling of "http://" in post body

0.1

  • Initial Release

Post/Page Syntax

To use a named tag in a page or post, use this syntax:

[name: text] ( uri )
name the name of the link, as defined in the configuration file text the text that the user wants to appear associated with this link. uri the uri of the link. Usage is dependent on the type of link, for example an anchor might use this as part of the href, whereas an img might use it as part of the src.

Configuration File

The slink_config.php file should be edited to establish named links:

HTML

slink_html( 'name', 'html' );
name Case-insensitive name of the named link. html

The html to insert. $text and $uri can be inserted into the html to refer to those parameters as entered in the post/page.

slink_html( 'name', '' );

PHP

slink_php( 'name', 'code'  );
name Case-insensitive name of the named link. code

The php code to execute. Like the HTML, $text and $uri can be used to refer to those parameters as entered in the post/page. The code need not return any value, but if it does, it should be a string, which will be inserted into the php. If you want to apply slink filtering to your return value, return slink_filter( $result ).

slink_php( 'name', 'return my_php_function( $uri, $text );' );

Requires: 2.0.2 or higher
Compatible up to: 2.7
Last Updated: 2009-4-9
Downloads: 318

Ratings

0 stars
0 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.