BBCode Plugin for WordPress

WordPress BBCode Markup Plugin

This plugin allows BBCode markup to be used in the posts, excerpts, and comments of WordPress. If you use this plugin, you should disable other markup plugins. This plugin has been tested with WordPress 1.2.

A much improved version of this plugin is currently under development and should be ready to download on this page before Nov 21, 2005. The new version:

  • Supports Wordpress 1.5.2 and 1.6.0 (when released).
  • No longer requires that you modify Word Press files.
  • Works correctly in posts, comments, pings, and trackbacks.
  • Fixes bugs that would allow unbalanced tags to occur.
  • Supports PHP syntax highlighting.

Download

Download WordPress BBCode

Installation

Download, uncompress and copy this file to your wp-content/plugins directory.

You must add the following line of code to your wp-includes/template-functions-post.php file at line 143:

    $output = apply_filters('the_excerpt', $output);
The code should look like this when it is in place:
function the_excerpt_rss($cut = 0, $encode_html = 0) {
    $output = get_the_excerpt(true);
    $output = apply_filters('the_excerpt', $output);

    $output = convert_chars($output);

Sorry about this requirement, but this compensates for an unfortunately bug/ommission/optimization in the plugin protocol. Without this line feeds are not processed properly. This problem may apply to some of the other markup types as well.

With this done go to the plugin management page in WordPress to activate the plugin.

You may wish to change your wp-comments, wp-comments-popup, and wp-comments-reply files to indicate that you now use BBCode.

Support

Post your bug reports or comments.

BBCode Markup Guide

[b]bold[/b]
[i]italic[/i]
[u]underline[/u]
[s]strike[/s]
[sub]subscript[/sub]
[sup]superscript[/sup]

[color=blue]blue text[/color]
[size=18]the size of this text is 18pt[/size]
[font=arial]different font type[/font]
[align=right]yes, you're right, this isn't on the left[/align]
he said: [quote=http://www.server.org/quote.html]i'm tony montana[/quote]
[code]x + y = 6;[/code]

http://www.server.org
[url]http://www.server.org[/url]
[url=http://www.server.org]server[/url]
[url=http://www.server.org target=new]server[/url]

guest@anonymous.org
[email]guest@anonymous.org[/email]
[email=guest@anonymous.org]mail me[/email]

[img]http://www.server.org/image.jpg[/img]
[img w=100 h=200]http://www.server.org/image.jpg[/img]

[ulist]
[*]unordered item 1
[*]unordered item 2
[/ulist]
[list]
[*]unordered item 1
[*]unordered item 2
[/list]

[list=1]
[*]ordered item 1
[*]ordered item 2
[/list]
[list=i]
[*]ordered item 1 type i
[li=4]ordered item 4 type i[/li]
[/list]
[list=I]
[*]ordered item 1 type I
[/list]
[list=a s=5]
[li]ordered item 5 type a[/li]
[*]ordered item 6 type a
[/list]
[list=A]
[li]ordered item 1 type A[/li]
[li=12]ordered item 12 type A[/li]
[/list]

[list=A s=3]
[li]ordered item 1, nested list:
    [list=I]
    [li]nested item 1[/li]
    [li]nested item 2[/li]
    [/list][/li]
[li]ordered item 2[/li]
[/list]

Credits

This plugin is based on HTML_BBCodeParser

Read my Blogs

Professional PHP Blog
Web Development with PHP, PHP Advocacy and Best Practices.

Lively Debate
My non-technical blog.

Expert PHP programmer for hire