WordPress.org

Ready to get started?Download WordPress

Forums

Wiki-Links Hack (4 posts)

  1. snej
    Member
    Posted 10 years ago #

    As my first attempt at hacking WordPress (or coding in PHP, for that matter) I've written a hack that extends the post formatting rules to allow you to create wiki-style links between posts.
    In a nutshell, you simply put the title of a post inside double square brackets, [[like this]], and it becomes a link to that post. There are some optional bits of syntax to restrict the lookup to posts in particular categories, to make the text of the link different from the post title, and to add a tooltip to the link.
    Of course, this isn't nearly all of what a real wiki does. But promiscuous interlinking is cool -- you can use it to make a kind of glossary in your blog and easily link to it from other posts. I think I'll be working on other wiki features in the future.

  2. Ryan Boren
    WordPress Dev
    Posted 10 years ago #

    You almost have a WordPress Plugin. You just need to add the plugin header at the top of your file. Here's an example header:
    /*
    Plugin Name: Hello Dolly
    Plugin URI: http://wordpress.org/#
    Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong. Hello, Dolly. This is, by the way, the world's first official WordPress plugin. When enabled you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen.
    Author: Matt Mullenweg
    Author URI: http://photomatt.net/
    */

    When your php file is placed in wp-content/plugins, it will show up in the plugin manager where it can be activated. You need a nightly build to do this.

  3. snej
    Member
    Posted 10 years ago #

    Thanks for the feedback!
    I am using 1.0.2 and have not started looking at 1.2 stuff yet, so I didn't know about plugins. I'll definitely add the plugin header to make life easier for you bleeding-edge types.

  4. carthik
    Member
    Posted 10 years ago #

    I think its a really cool plugin. Now if we could have one that fetches the N most closely related posts to the current post, on the basis of content... but, seriously, this is a cool hack. I will wait till 1.2 is out before I get it running, though.
    But often, I find none of my posts worth linking to, though. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.