Changeset 6395
- Timestamp:
- 10/08/2012 09:16:00 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-screens.php
r6285 r6395 264 264 265 265 /** 266 * The main theme compat class for BuddyPress Groups266 * The main theme compat class for BuddyPress Members. 267 267 * 268 268 * This class sets up the necessary theme compatability actions to safely output … … 274 274 275 275 /** 276 * Setup the groups component theme compatibility276 * Setup the members component theme compatibility 277 277 * 278 278 * @since BuddyPress (1.7) … … 283 283 284 284 /** 285 * Are we looking at something that needs grouptheme compatability?285 * Are we looking at something that needs members theme compatability? 286 286 * 287 287 * @since BuddyPress (1.7) … … 289 289 public function is_members() { 290 290 291 // Bail if not looking at a group292 if ( ! bp_is_members_component() )291 // Bail if not looking at the members component or a user's page 292 if ( ! bp_is_members_component() && ! bp_displayed_user_id() ) 293 293 return; 294 294 295 // GroupDirectory295 // Members Directory 296 296 if ( ! bp_current_action() && ! bp_current_item() ) { 297 297 bp_update_is_directory( true, 'members' ); 298 298 299 do_action( ' members_directory_groups_setup' );299 do_action( 'bp_members_screen_index' ); 300 300 301 301 add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) ); 302 302 add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); 303 304 // User page 305 } elseif ( bp_displayed_user_id() ) { 306 add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) ); 307 add_filter( 'bp_replace_the_content', array( $this, 'single_dummy_content' ) ); 308 303 309 } 304 310 } … … 326 332 327 333 /** 328 * Filter the_content with the groups index template part334 * Filter the_content with the members index template part 329 335 * 330 336 * @since BuddyPress (1.7) … … 333 339 bp_buffer_template_part( 'members/index' ); 334 340 } 341 342 /** Single ****************************************************************/ 343 344 /** 345 * Update the global $post with the displayed user's data 346 * 347 * @since BuddyPress (1.7) 348 */ 349 public function single_dummy_post() { 350 bp_theme_compat_reset_post( array( 351 'ID' => 0, 352 'post_title' => bp_get_displayed_user_fullname(), 353 'post_author' => 0, 354 'post_date' => 0, 355 'post_content' => '', 356 'post_type' => 'bp_members', 357 'post_status' => 'publish', 358 'is_archive' => true, 359 'comment_status' => 'closed' 360 ) ); 361 } 362 363 /** 364 * Filter the_content with the members' single home template part 365 * 366 * @since BuddyPress (1.7) 367 */ 368 public function single_dummy_content() { 369 bp_buffer_template_part( 'members/single/home' ); 370 } 335 371 } 336 372 new BP_Members_Theme_Compat(); -
trunk/bp-xprofile/bp-xprofile-screens.php
r6332 r6395 192 192 bp_core_load_template( apply_filters( 'xprofile_template_change_avatar', 'members/single/home' ) ); 193 193 } 194 195 /** Theme Compatability *******************************************************/196 197 /**198 * The main theme compat class for BuddyPress Profiles199 *200 * This class sets up the necessary theme compatability actions to safely output201 * group template parts to the_title and the_content areas of a theme.202 *203 * @since BuddyPress (1.7)204 */205 class BP_XProfile_Theme_Compat {206 207 /**208 * Setup the xprofile component theme compatibility209 *210 * @since BuddyPress (1.7)211 *212 * @todo is 'bp_screens' correct here?213 */214 public function __construct() {215 add_action( 'bp_setup_theme_compat', array( $this, 'is_xprofile' ) );216 }217 218 /**219 * Are we looking at something that needs group theme compatability?220 *221 * @since BuddyPress (1.7)222 */223 public function is_xprofile() {224 225 // Bail if not looking at a profile226 if ( ! bp_displayed_user_id() )227 return;228 229 // Creating a group230 add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'dummy_post' ) );231 add_filter( 'bp_replace_the_content', array( $this, 'dummy_content' ) );232 }233 234 /** Directory *************************************************************/235 236 /**237 * Update the global $post with directory data238 *239 * @since BuddyPress (1.7)240 */241 public function dummy_post() {242 bp_theme_compat_reset_post( array(243 'ID' => 0,244 'post_title' => bp_get_displayed_user_fullname(),245 'post_author' => 0,246 'post_date' => 0,247 'post_content' => '',248 'post_type' => 'bp_xprofile',249 'post_status' => 'publish',250 'is_archive' => true,251 'comment_status' => 'closed'252 ) );253 }254 255 /**256 * Filter the_content with the groups index template part257 *258 * @since BuddyPress (1.7)259 */260 public function dummy_content() {261 bp_buffer_template_part( 'members/single/home' );262 }263 }264 new BP_XProfile_Theme_Compat();
Note: See TracChangeset
for help on using the changeset viewer.