Title: Adding own BBCode
Last modified: December 23, 2016

---

# Adding own BBCode

 *  [alienvenom](https://wordpress.org/support/users/alienvenom/)
 * (@alienvenom)
 * [22 years, 3 months ago](https://wordpress.org/support/topic/adding-own-bbcode/)
 * I wanted to add the [code] tag to the bbcode function.
    Here's what I changed:
   wp_bbcode['in']: '#\[code](.+?)]\[/code]#is', // Code tag wp_bbcode['out']: '
   <div class=\"code\">$1</div>', // Code Any ideas? Edit: Oh, right... yeah it 
   doesn't work. 🙁 I added this in /wp-includes/var.php above the two commented
   out e-mail tags (by default...)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [alienvenom](https://wordpress.org/support/users/alienvenom/)
 * (@alienvenom)
 * [22 years, 3 months ago](https://wordpress.org/support/topic/adding-own-bbcode/#post-39873)
 * Any ideas? Anyone?
 *  [LoganSix](https://wordpress.org/support/users/logansix/)
 * (@logansix)
 * [22 years, 3 months ago](https://wordpress.org/support/topic/adding-own-bbcode/#post-39966)
 * <div class=\”code\”>$1</div>
    This part might be wrong. You don’t have to put
   in the \ around the quotes for the array string, since it starts with a single
   quote.
 *  [LoganSix](https://wordpress.org/support/users/logansix/)
 * (@logansix)
 * [22 years, 3 months ago](https://wordpress.org/support/topic/adding-own-bbcode/#post-39967)
 * Okay.
    Let’s talk wacko. I got it to work. Do this. Copy the line for the bold[
   b] tags in the “in” array. Paste it into a new line after the bold code. Then
   change the “b” to “code”. Make sure you move the “out” array line up to the line
   after the bolde code line. I guess it has to do with a tab or spacing or someting
   odd.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding own BBCode’ is closed to new replies.

 * 3 replies
 * 2 participants
 * Last reply from: [LoganSix](https://wordpress.org/support/users/logansix/)
 * Last activity: [22 years, 3 months ago](https://wordpress.org/support/topic/adding-own-bbcode/#post-39967)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
