Title: Custom plugin help
Last modified: August 19, 2016

---

# Custom plugin help

 *  [t_clauss](https://wordpress.org/support/users/t_clauss/)
 * (@t_clauss)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/custom-plugin-help/)
 * Ok, well I managed to get a plugin working for gwbbcode.
 *     ```
       <?php
       function Wp_gwbbcode($text) {
          $text = parse_gwbbcode($text);
             return $text;
          }
       // Apply the filters, to get things going
       add_filter('the_content', 'Wp_gwbbcode');
       ?>
       ```
   
 * I’m having a few issues with it. At the moment whenever you try to create a new
   post/page I get an error saying it failed. But if you go back to manage they 
   are there unpublished. Editing them works fine after they have already been created.
   Things work fine when its disabled so I’m assuming its this plugin.
 * Any suggestions?

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

 *  Thread Starter [t_clauss](https://wordpress.org/support/users/t_clauss/)
 * (@t_clauss)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/custom-plugin-help/#post-837092)
 * I think whats happening is when im writing a new post/page its trying to parse,
   is there a way to exclude it from doing this when writing content. Its weird 
   because u can edit a post/page properly after its made. Just the initial creation
   says it failed.
 * I have this located in index.php in the wp directory
 *     ```
       <?php
       if (!defined('GWBBCODE_ROOT')) {
       define('GWBBCODE_ROOT', './gwbbcode');
       require_once(GWBBCODE_ROOT.'/gwbbcode.inc.php');
       }?>
       ```
   
 * How would I go about putting that code into my plugin itself? BTW gwbbcode is
   in the base directory of wordpress.
 *  Thread Starter [t_clauss](https://wordpress.org/support/users/t_clauss/)
 * (@t_clauss)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/custom-plugin-help/#post-837189)
 * Here are some options id like to add:
 * – Adding the “if !defined, define, and require_once, to the plugin itself instead
   of adding lines to index.php
    – A option in the admin menu to tell wordpress 
   where gwbbcode is installed – Option for parsing in comments – Option to hide
   gwbbcode from unregistered users, so they see nothing instead of [yourgwbbcode]
 * And finially, working out the new post/page bug from the dashboard. (it does 
   create them, just doesnt publish right away. Instead gives you an error.)
 * More info on gwbbcode can be found here:
    [http://gwshack.us/forums/viewtopic.php?t=14242](http://gwshack.us/forums/viewtopic.php?t=14242)
 *  Thread Starter [t_clauss](https://wordpress.org/support/users/t_clauss/)
 * (@t_clauss)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/custom-plugin-help/#post-837193)
 * Ok, I feel pretty dumb I’ve worked out the new post/page bug, I had too many 
   <?php, and ?> tags.

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

The topic ‘Custom plugin help’ is closed to new replies.

 * 3 replies
 * 1 participant
 * Last reply from: [t_clauss](https://wordpress.org/support/users/t_clauss/)
 * Last activity: [17 years, 7 months ago](https://wordpress.org/support/topic/custom-plugin-help/#post-837193)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
