Changeset 6866
- Timestamp:
- 03/25/2013 08:00:06 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-theme-compatibility.php
r6658 r6866 49 49 * @var array 50 50 */ 51 pr ivate$_data = array();51 protected $_data = array(); 52 52 53 53 /** … … 60 60 $this->_data = $properties; 61 61 } 62 63 64 /** 65 * Themes shoud use this method in their constructor. 66 * 67 * In this method, we check all types of conditions where theme compatibility 68 * should *not* run. 69 * 70 * If we pass all conditions, then we setup some additional methods to use. 71 * 72 * @since BuddyPress (1.7) 73 */ 74 protected function start() { 75 76 // If the theme supports 'buddypress', bail. 77 if ( current_theme_supports( 'buddypress' ) ) { 78 return; 79 80 // If the theme doesn't support BP, do some additional checks 81 } else { 82 // Bail if theme is a derivative of bp-default 83 if ( in_array( 'bp-default', array( get_template(), get_stylesheet() ) ) ) { 84 return; 85 } 86 87 // Bruteforce check for a BP template 88 // Examples are clones of bp-default 89 if ( locate_template( 'members/members-loop.php', false, false ) ) { 90 return; 91 } 92 } 93 94 // Setup methods 95 $this->setup_globals(); 96 $this->setup_actions(); 97 } 98 99 /** 100 * Meant to be extended in your class. 101 * 102 * @since BuddyPress (1.7) 103 */ 104 protected function setup_globals() {} 105 106 /** 107 * Meant to be extended in your class. 108 * 109 * @since BuddyPress (1.7) 110 */ 111 protected function setup_actions() {} 62 112 63 113 /** -
trunk/bp-templates/bp-legacy/buddypress-functions.php
r6850 r6866 46 46 */ 47 47 public function __construct() { 48 49 // Bail if theme is a derivative of bp-default 50 if ( in_array( 'bp-default', array( get_template(), get_stylesheet() ) ) ) { 51 return; 52 } 53 54 // Or if the theme supports 'buddypress' 55 if ( current_theme_supports( 'buddypress' ) ) { 56 return; 57 } 58 59 $this->setup_globals(); 60 $this->setup_actions(); 48 parent::start(); 61 49 } 62 50 63 51 /** 64 52 * Component global variables 65 *66 * Note that this function is currently commented out in the constructor.67 * It will only be used if you copy this file into your current theme and68 * uncomment the line above.69 53 * 70 54 * You'll want to customize the values in here, so they match whatever your … … 74 58 * @access private 75 59 */ 76 pr ivatefunction setup_globals() {60 protected function setup_globals() { 77 61 $bp = buddypress(); 78 62 $this->id = 'legacy'; … … 92 76 * @uses add_action() To add various actions 93 77 */ 94 pr ivatefunction setup_actions() {78 protected function setup_actions() { 95 79 96 80 // Template Output
Note: See TracChangeset
for help on using the changeset viewer.