Changeset 3928
- Timestamp:
- 05/31/2012 05:02:02 AM (14 years ago)
- Location:
- branches/plugin
- Files:
-
- 4 edited
-
bbp-includes/bbp-theme-compatibility.php (modified) (1 diff)
-
bbp-theme-compat/bbpress-functions.php (modified) (1 diff)
-
bbp-themes/bbp-twentyten/bbpress-functions.php (modified) (1 diff)
-
bbpress.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-theme-compatibility.php
r3927 r3928 268 268 * @param array $theme 269 269 */ 270 function bbp_register_theme_package( $theme = '', $override = true ) { 271 272 // Bail if no name or object passed is not a theme compat theme 270 function bbp_register_theme_package( $theme = array(), $override = true ) { 271 272 // Create new BBP_Theme_Compat object from the $theme array 273 if ( is_array( $theme ) ) 274 $theme = new BBP_Theme_Compat( $theme ); 275 276 // Bail if $theme isn't a proper object 273 277 if ( ! is_a( $theme, 'BBP_Theme_Compat' ) ) 274 278 return; -
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 -
branches/plugin/bbp-themes/bbp-twentyten/bbpress-functions.php
r3849 r3928 62 62 $this->dir = trailingslashit( $bbp->themes_dir . 'bbp-twentyten' ); 63 63 $this->url = trailingslashit( $bbp->themes_url . 'bbp-twentyten' ); 64 65 // Conditionally add theme support if needed66 if ( in_array( $this->id, array( get_template(), get_stylesheet() ) ) ) {67 add_theme_support( 'bbpress' );68 }69 64 } 70 65 -
branches/plugin/bbpress.php
r3927 r3928 533 533 /** Default Theme *****************************************************/ 534 534 535 bbp_register_theme_package( new BBP_Theme_Compat( array(535 bbp_register_theme_package( array( 536 536 'id' => 'default', 537 537 'name' => __( 'bbPress Default', 'bbpress' ), … … 539 539 'dir' => trailingslashit( $this->plugin_dir . 'bbp-theme-compat' ), 540 540 'url' => trailingslashit( $this->plugin_url . 'bbp-theme-compat' ) 541 ) ) );541 ) ); 542 542 543 543 /** Twenty Ten ********************************************************/ 544 544 545 bbp_register_theme_package( new BBP_Theme_Compat( array(545 bbp_register_theme_package( array( 546 546 'id' => 'bbp-twentyten', 547 547 'name' => __( 'Twenty Ten (bbPress)', 'bbpress' ), … … 549 549 'dir' => trailingslashit( $this->themes_dir . 'bbp-twentyten' ), 550 550 'url' => trailingslashit( $this->themes_url . 'bbp-twentyten' ) 551 ) ) );551 ) ); 552 552 } 553 553
Note: See TracChangeset
for help on using the changeset viewer.