Changeset 6285 for trunk/bp-xprofile/bp-xprofile-screens.php
- Timestamp:
- 09/03/2012 12:33:13 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-xprofile/bp-xprofile-screens.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-screens.php
r6070 r6285 190 190 } 191 191 192 ?> 192 /** Theme Compatability *******************************************************/ 193 194 /** 195 * The main theme compat class for BuddyPress Profiles 196 * 197 * This class sets up the necessary theme compatability actions to safely output 198 * group template parts to the_title and the_content areas of a theme. 199 * 200 * @since BuddyPress (1.7) 201 */ 202 class BP_XProfile_Theme_Compat { 203 204 /** 205 * Setup the xprofile component theme compatibility 206 * 207 * @since BuddyPress (1.7) 208 * 209 * @todo is 'bp_screens' correct here? 210 */ 211 public function __construct() { 212 add_action( 'bp_setup_theme_compat', array( $this, 'is_xprofile' ) ); 213 } 214 215 /** 216 * Are we looking at something that needs group theme compatability? 217 * 218 * @since BuddyPress (1.7) 219 */ 220 public function is_xprofile() { 221 222 // Bail if not looking at a profile 223 if ( ! bp_displayed_user_id() ) 224 return; 225 226 // Creating a group 227 add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'dummy_post' ) ); 228 add_filter( 'bp_replace_the_content', array( $this, 'dummy_content' ) ); 229 } 230 231 /** Directory *************************************************************/ 232 233 /** 234 * Update the global $post with directory data 235 * 236 * @since BuddyPress (1.7) 237 */ 238 public function dummy_post() { 239 bp_theme_compat_reset_post( array( 240 'ID' => 0, 241 'post_title' => bp_get_displayed_user_fullname(), 242 'post_author' => 0, 243 'post_date' => 0, 244 'post_content' => '', 245 'post_type' => 'bp_xprofile', 246 'post_status' => 'publish', 247 'is_archive' => true, 248 'comment_status' => 'closed' 249 ) ); 250 } 251 252 /** 253 * Filter the_content with the groups index template part 254 * 255 * @since BuddyPress (1.7) 256 */ 257 public function dummy_content() { 258 bp_buffer_template_part( 'members/single/home' ); 259 } 260 } 261 new BP_XProfile_Theme_Compat();
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)