Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/31/2012 05:02:02 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Theme Compatibility:

  • Clean up bbpress-functions.php for Twenty Ten and Default theme packages.
  • Simplify bbp_register_theme_package() to accept an array or a BBP_Theme_Compat object.
  • Update bbPress::register_theme_packages() to use new style above.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-theme-compat/bbpress-functions.php

    r3925 r3928  
    6464         */
    6565        private function setup_globals() {
    66 
    67                 // Use the default theme compat if current theme has not added support
    68                 if ( !current_theme_supports( 'bbpress' ) ) {
    69                         $this->id      = bbp_get_theme_compat_id();
    70                         $this->name    = bbp_get_theme_compat_name();
    71                         $this->version = bbp_get_theme_compat_version();
    72                         $this->dir     = bbp_get_theme_compat_dir();
    73                         $this->url     = bbp_get_theme_compat_url();
    74 
    75                 // Theme supports bbPress, so set some smart defaults
    76                 } else {
    77 
    78                         // @todo Remove function_exists check when WordPress 3.5 ships
    79                         $theme         = function_exists( 'wp_get_theme' ) ? wp_get_theme() : get_current_theme();
    80                         $this->id      = $theme->stylesheet;
    81                         $this->name    = sprintf( __( '%s (bbPress)', 'bbpress' ), $theme->name ) ;
    82                         $this->version = bbp_get_version();
    83                         $this->dir     = trailingslashit( get_stylesheet_directory() );
    84                         $this->url     = trailingslashit( get_stylesheet_directory_uri() );
    85                 }
    86 
    87                 // Conditionally add theme support if needed
    88                 if ( in_array( $this->id, array( get_template(), get_stylesheet() ) ) ) {
    89                         add_theme_support( 'bbpress' );
    90                 }
     66                $bbp           = bbpress();
     67                $this->id      = 'default';
     68                $this->name    = __( 'bbPress Default', 'bbpress' );
     69                $this->version = bbp_get_version();
     70                $this->dir     = trailingslashit( $bbp->plugin_dir . 'bbp-theme-compat' );
     71                $this->url     = trailingslashit( $bbp->plugin_url . 'bbp-theme-compat' );
    9172        }
    9273
Note: See TracChangeset for help on using the changeset viewer.