Changeset 6395 for trunk/bp-xprofile/bp-xprofile-screens.php
- Timestamp:
- 10/08/2012 09:16:00 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.