Changeset 6399
- Timestamp:
- 10/13/2012 06:29:56 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-theme-compatibility.php
r6390 r6399 33 33 * 34 34 * @since BuddyPress (1.7) 35 * @todo We should probably do something similar to BP_Component::start() 35 36 */ 36 37 class BP_Theme_Compat { … … 56 57 * @param array $properties 57 58 */ 58 public function __construct( Array $properties = array() ) {59 public function __construct( Array $properties = array() ) { 59 60 $this->_data = $properties; 60 61 } … … 91 92 * 92 93 * @since BuddyPress (1.7) 93 * @param B BP_Theme_Compat $theme94 * @param BP_Theme_Compat $theme 94 95 */ 95 96 function bp_setup_theme_compat( $theme = '' ) { … … 176 177 177 178 /** 178 * Gets true/false if page is currently inside theme compatibility 179 * See whether BuddyPress' theme compatibility is enabled or not. 180 * 181 * This differs from {@link bp_is_theme_compat_active()} as this function 182 * checks to see if theme compat is enabled across the active blog. 183 * 184 * @since BuddyPress (1.7) 185 * @uses wp_get_theme() 186 * @uses apply_filters() 187 * @return bool 188 */ 189 function bp_enable_theme_compat() { 190 191 // default is theme compat should be enabled 192 $retval = true; 193 194 // get current theme 195 $theme = wp_get_theme(); 196 197 // get current theme's tags 198 $theme_tags = ! empty( $theme->tags ) ? $theme->tags : array(); 199 200 // check to see if the 'buddypress' tag is in the theme 201 // or if stylesheet is 'bp-default' 202 $backpat = in_array( 'buddypress', $theme_tags ) || $theme->get_stylesheet() == 'bp-default'; 203 204 // if we're already using a BP-compatible theme, disable theme compat 205 if ( $backpat ) { 206 $retval = false; 207 208 // if theme compat should still be enabled, do some other checks 209 // @todo what about themes that copied bp-default without using a child theme? 210 } elseif ( $retval ) { 211 // BP Template Pack check 212 // if TPack exists, we should disable theme compat 213 if ( function_exists( 'bp_tpack_theme_setup' ) ) { 214 $retval = false; 215 } 216 } 217 218 return apply_filters( 'bp_enable_theme_compat', $retval ); 219 } 220 221 /** 222 * Gets true/false if the current, loaded page uses theme compatibility 179 223 * 180 224 * @since BuddyPress (1.7) … … 270 314 function bp_register_theme_package( $theme = array(), $override = true ) { 271 315 272 // Create new B BP_Theme_Compat object from the $theme array316 // Create new BP_Theme_Compat object from the $theme array 273 317 if ( is_array( $theme ) ) 274 318 $theme = new BP_Theme_Compat( $theme ); -
trunk/bp-members/bp-members-functions.php
r6342 r6399 1396 1396 return; 1397 1397 1398 // Redirect to sign-up page 1399 if ( locate_template( array( 'registration/register.php' ), false ) || locate_template( array( 'register.php' ), false) )1398 // Redirect to sign-up page if a custom signup page exists 1399 if ( bp_has_custom_signup_page() ) 1400 1400 bp_core_redirect( bp_get_signup_page() ); 1401 1401 } -
trunk/bp-members/bp-members-template.php
r6368 r6399 968 968 969 969 function bp_has_custom_signup_page() { 970 // if theme compat is enabled, we're already using our bundled templates 971 if ( bp_enable_theme_compat() ) 972 return true; 973 974 // look in parent / child theme for custom registration templates 970 975 if ( locate_template( array( 'register.php' ), false ) || locate_template( array( '/registration/register.php' ), false ) ) 971 976 return true; -
trunk/bp-themes/bp-legacy/buddypress-functions.php
r6387 r6399 47 47 public function __construct() { 48 48 49 // Bail if parent/child themes are bp-default50 if ( in_array( 'bp-default', array( get_template(), get_stylesheet() )) )49 // Bail if theme compat should be disabled 50 if ( ! bp_enable_theme_compat() ) 51 51 return; 52 52
Note: See TracChangeset
for help on using the changeset viewer.