0, 'post_title' => $title, 'post_author' => 0, 'post_date' => 0, 'post_content' => '', 'post_type' => 'bp_blogs', 'post_status' => 'publish', 'is_page' => true, 'comment_status' => 'closed' ) ); } /** * Filter the_content with the groups index template part. * * @since BuddyPress (1.7.0) */ public function directory_content() { return bp_buffer_template_part( 'blogs/index', null, false ); } /** Create ****************************************************************/ /** * Add custom template hierarchy to theme compat for the blog create page. * * This is to mirror how WordPress has * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. * * @since BuddyPress (1.8.0) * * @param string $templates The templates from * bp_get_theme_compat_templates(). * @return array $templates Array of custom templates to look for. */ public function create_template_hierarchy( $templates ) { // Setup our templates based on priority $new_templates = apply_filters( 'bp_template_hierarchy_blogs_create', array( 'blogs/index-create.php' ) ); // Merge new templates with existing stack // @see bp_get_theme_compat_templates() $templates = array_merge( (array) $new_templates, $templates ); return $templates; } /** * Update the global $post with create screen data. * * @since BuddyPress (1.7.0) */ public function create_dummy_post() { // Title based on ability to create blogs if ( is_user_logged_in() && bp_blog_signup_enabled() ) { $title = '' . __( 'Sites', 'buddypress' ) . ' ' . __( 'Create a Site', 'buddypress' ); } else { $title = __( 'Sites', 'buddypress' ); } bp_theme_compat_reset_post( array( 'ID' => 0, 'post_title' => $title, 'post_author' => 0, 'post_date' => 0, 'post_content' => '', 'post_type' => 'bp_group', 'post_status' => 'publish', 'is_page' => true, 'comment_status' => 'closed' ) ); } /** * Filter the_content with the create screen template part. * * @since BuddyPress (1.7.0) */ public function create_content() { return bp_buffer_template_part( 'blogs/create', null, false ); } } new BP_Blogs_Theme_Compat();