Changeset 6404
- Timestamp:
- 10/13/2012 06:20:07 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-catchuri.php
r6402 r6404 459 459 460 460 $defaults = array( 461 'mode' => bp_ enable_theme_compat() ? 2 : 1, // 1 = $root, 2 = wp-login.php461 'mode' => bp_is_theme_bp_default() ? 1 : 2, // 1 = $root, 2 = wp-login.php 462 462 'redirect' => $redirect_url, // the URL you get redirected to when a user successfully logs in 463 463 'root' => bp_get_root_domain(), // the landing page you get redirected to when a user doesn't have access -
trunk/bp-core/bp-core-filters.php
r6354 r6404 229 229 230 230 // Don't touch the email if we don't have a custom registration template 231 if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false) )231 if ( ! bp_has_custom_signup_page() ) 232 232 return $welcome_email; 233 233 … … 254 254 255 255 // Don't touch the email if we don't have a custom registration template 256 if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false) )256 if ( ! bp_has_custom_signup_page() ) 257 257 return $welcome_email; 258 258 -
trunk/bp-core/bp-core-theme-compatibility.php
r6399 r6404 177 177 178 178 /** 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() 179 * See whether the current theme is good ol' bp-default. 180 * 181 * @since BuddyPress (1.7) 182 * @uses get_stylesheet() 187 183 * @return bool 188 184 */ 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 ) { 185 function bp_is_theme_bp_default() { 186 if ( get_stylesheet() == 'bp-default' ) { 187 $retval = true; 188 } else { 206 189 $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 ); 190 } 191 192 return $retval; 219 193 } 220 194 -
trunk/bp-members/bp-members-template.php
r6399 r6404 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() ) 970 // if theme is not bp-default, theme compat is on 971 // theme compat already bundles its own templates 972 if ( ! bp_is_theme_bp_default() ) 972 973 return true; 973 974 -
trunk/bp-themes/bp-legacy/buddypress-functions.php
r6399 r6404 47 47 public function __construct() { 48 48 49 // Bail if theme compat should be disabled50 if ( ! bp_enable_theme_compat() )49 // Bail if theme is a derivative of bp-default 50 if ( bp_is_theme_bp_default() ) 51 51 return; 52 52
Note: See TracChangeset
for help on using the changeset viewer.