Changeset 6404 for trunk/bp-core/bp-core-theme-compatibility.php
- Timestamp:
- 10/13/2012 06:20:07 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-theme-compatibility.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.