Results 1 to 5 of 5
-
18th Dec 2010, 08:52 AM #1OPMember
Wordpress BBcode Help
Guys there is a wordpress plugin for BBcode. It can be found here:
http://wordpress.org/extend/plugins/bbcode/
Code:class BBCode { // Plugin initialization function BBCode() { // This version only supports WP 2.5+ (learn to upgrade please!) if ( !function_exists('add_shortcode') ) return; // Register the shortcodes add_shortcode( 'b' , array(&$this, 'shortcode_bold') ); add_shortcode( 'i' , array(&$this, 'shortcode_italics') ); add_shortcode( 'u' , array(&$this, 'shortcode_underline') ); add_shortcode( 'url' , array(&$this, 'shortcode_url') ); add_shortcode( 'img' , array(&$this, 'shortcode_image') ); add_shortcode( 'quote' , array(&$this, 'shortcode_quote') ); } // No-name attribute fixing function attributefix( $atts = array() ) { if ( empty($atts[0]) ) return $atts; if ( 0 !== preg_match( '#=("|\')(.*?)("|\')#', $atts[0], $match ) ) $atts[0] = $match[2]; return $atts; } // Bold shortcode function shortcode_bold( $atts = array(), $content = NULL ) { if ( NULL === $content ) return ''; return '<strong>' . do_shortcode( $content ) . '</strong>'; } // Italics shortcode function shortcode_italics( $atts = array(), $content = NULL ) { if ( NULL === $content ) return ''; return '<em>' . do_shortcode( $content ) . '</em>'; } // Italics shortcode function shortcode_underline( $atts = array(), $content = NULL ) { if ( NULL === $content ) return ''; return '<span style="text-decoration:underline">' . do_shortcode( $content ) . '</span>'; } // Italics shortcode function shortcode_url( $atts = array(), $content = NULL ) { $atts = $this->attributefix( $atts ); // Google if ( isset($atts[0]) ) { $url = $atts[0]; $text = $content; } // http://www.google.com/ else { $url = $text = $content; } if ( empty($url) ) return ''; if ( empty($text) ) $text = $url; return '<a href="' . $url . '">' . do_shortcode( $text ) . '</a>'; } // Italics shortcode function shortcode_image( $atts = array(), $content = NULL ) { if ( NULL === $content ) return ''; return '<img src="' . $content . '" alt="" />'; } // Italics shortcode function shortcode_quote( $atts = array(), $content = NULL ) { if ( NULL === $content ) return ''; return '<blockquote>' . do_shortcode( $content ) . '</blockquote>'; } } // Start this plugin once all other plugins are fully loaded add_action( 'plugins_loaded', create_function( '', 'global $BBCode; $BBCode = new BBCode();' ) );
kiddo Reviewed by kiddo on . Wordpress BBcode Help Guys there is a wordpress plugin for BBcode. It can be found here: http://wordpress.org/extend/plugins/bbcode/ class BBCode { // Plugin initialization function BBCode() { // This version only supports WP 2.5+ (learn to upgrade please!) if ( !function_exists('add_shortcode') ) return; Rating: 5
-
22nd Dec 2010, 09:29 PM #2OPMember
Never mind. I sat and coded it on my own.
-
22nd Dec 2010, 09:34 PM #3MemberWebsite's:
scrls.co.ukWhy use this why not just edit the codex ?
But yeah if you got it then gratz
-
22nd Dec 2010, 10:00 PM #4Member
Well its damn easy.
Just replace [code] with <blockquote> using STR REPLACE function in PHP. Its easy. No need for plugin shit.
-
23rd Dec 2010, 03:04 AM #5MemberWebsite's:
host4offshore.comyour plugin is backdated
Requires WordPress Version: 2.5 or higher
Last Updated: 2008-6-24
i will say you use
gorzek's BBCode Filter
or
WP BBCodes to HTML Parser
after install this you can use bbcode into your post|| Host4Offshore :: Reliable, Quality, Fast Offshore Hosting Solution (USA/Netherlands/Sweden/Russia/Romania)
|| Shared , Reseller Hosting Sales Thread
|| Rapidleech Hosting Sales Thread
|| Current Promotion
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
need help with Wordpress BBcode
By divineee in forum Webmaster DiscussionReplies: 1Last Post: 1st Sep 2012, 01:16 AM -
wordpress bbcode help
By indianmoviefans.info in forum Webmaster DiscussionReplies: 7Last Post: 23rd Nov 2011, 07:12 PM -
BBCode in Wordpress - W/O a plugin
By Apathetic in forum WordpressReplies: 11Last Post: 7th Oct 2011, 11:18 AM -
Wordpress BBCode Help
By Gempis in forum Technical Help Desk SupportReplies: 5Last Post: 13th Jul 2011, 05:09 PM -
Need wordpress BBcode plugin
By only1_PO in forum WordpressReplies: 1Last Post: 21st Aug 2009, 08:54 AM
themaPoster - post to forums and...
Version 5.36 released. Open older version (or...