_data = $properties; } /** * Set up the BuddyPress-specific theme compat methods. * * Themes should use this method in their constructor. * * @since 1.7.0 */ protected function start() { // Sanity check. if ( ! bp_use_theme_compat_with_current_theme() ) { return; } // Setup methods. $this->setup_globals(); $this->setup_actions(); } /** * Set up global data for your template package. * * Meant to be overridden in your class. See * {@link BP_Legacy::setup_globals()} for an example. * * @since 1.7.0 */ protected function setup_globals() {} /** * Set up theme hooks for your template package. * * Meant to be overridden in your class. See * {@link BP_Legacy::setup_actions()} for an example. * * @since 1.7.0 */ protected function setup_actions() {} /** * Set a theme's property. * * @since 1.7.0 * * @param string $property Property name. * @param mixed $value Property value. * @return bool True on success, false on failure. */ public function __set( $property, $value ) { return $this->_data[$property] = $value; } /** * Get a theme's property. * * @since 1.7.0 * * @param string $property Property name. * @return mixed The value of the property if it exists, otherwise an * empty string. */ public function __get( $property ) { return array_key_exists( $property, $this->_data ) ? $this->_data[$property] : ''; } /** * Check a theme's property exists. * * @since 9.0.0 * * @param string $property Property name. * @return bool True if the property exists. False otherwise. */ public function __isset( $property ) { return array_key_exists( $property, $this->_data ); } }