Changeset 3928 for branches/plugin/bbp-theme-compat/bbpress-functions.php
- Timestamp:
- 05/31/2012 05:02:02 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-theme-compat/bbpress-functions.php
r3925 r3928 64 64 */ 65 65 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' ); 91 72 } 92 73
Note: See TracChangeset
for help on using the changeset viewer.