Advertisement
sgaffney

bbpress initialization

Nov 5th, 2011
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.33 KB | None | 0 0
  1. /*
  2. I started by creating a plugin folder named 'tumbleboard'
  3.  
  4. I created a sub-folder inside tumbleboard called 'wptumble-twentyten' and placed all of the theme files in there. I followed the exact file naming schema as bbpress uses.
  5.  
  6. As with the default bbpress plugin theme folder I also have a folder inside 'wptumble-twentyten/bbpress' which contains the same files bbpress uses.
  7.  
  8. *basically I kept identical structure.
  9.  
  10. I then added the following function to the bottom of my plugin initialization file.
  11.  
  12. When I activate the plugin the forum does indeed call the proper css file from my template, and also calls the initial template. However none of the include templates show up, and it's kinda messed up.
  13.  
  14. Is the below function even close to right?
  15. /*
  16.  
  17. function wptumble_setup_theme_compat( $theme = '' ) {
  18.     global $bbp;
  19.  
  20.     // Check if current theme supports bbPress
  21.         if ( empty( $theme ) ) {
  22.             $theme          = new BBP_Theme_Compat();
  23.             $theme->name    = 'Tumbleboard';
  24.             $theme->version = '20111105';
  25.             $theme->dir     = WP_PLUGIN_DIR . '/tumbleboard/wptumble-twentyten';
  26.             $theme->url     = WP_PLUGIN_URL . '/tumbleboard/wptumble-twentyten';
  27.         }
  28.  
  29.         // Set the theme compat globals for help with loading template parts
  30.         $bbp->theme_compat->theme = $theme;
  31.     }
  32.  
  33. add_action( 'bbp_init', 'wptumble_setup_theme_compat', 6 );
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement