Changeset 9157 for trunk/src/bp-blogs/bp-blogs-screens.php
- Timestamp:
- 11/21/2014 06:24:16 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-screens.php
r8682 r9157 142 142 public function directory_dummy_post() { 143 143 144 $title = apply_filters( 'bp_blogs_directory_header', __( 'Sites', 'buddypress' ) ); 144 bp_theme_compat_reset_post( array( 145 'ID' => 0, 146 'post_title' => __( 'Sites', 'buddypress' ), 147 'post_author' => 0, 148 'post_date' => 0, 149 'post_content' => '', 150 'post_type' => 'page', 151 'post_status' => 'publish', 152 'is_page' => true, 153 'comment_status' => 'closed' 154 ) ); 155 } 156 157 /** 158 * Filter the_content with the groups index template part. 159 * 160 * @since BuddyPress (1.7.0) 161 */ 162 public function directory_content() { 163 return bp_buffer_template_part( 'blogs/index', null, false ); 164 } 165 166 /** Create ****************************************************************/ 167 168 /** 169 * Add custom template hierarchy to theme compat for the blog create page. 170 * 171 * This is to mirror how WordPress has 172 * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. 173 * 174 * @since BuddyPress (1.8.0) 175 * 176 * @param string $templates The templates from 177 * bp_get_theme_compat_templates(). 178 * @return array $templates Array of custom templates to look for. 179 */ 180 public function create_template_hierarchy( $templates ) { 181 // Setup our templates based on priority 182 $new_templates = apply_filters( 'bp_template_hierarchy_blogs_create', array( 183 'blogs/index-create.php' 184 ) ); 185 186 // Merge new templates with existing stack 187 // @see bp_get_theme_compat_templates() 188 $templates = array_merge( (array) $new_templates, $templates ); 189 190 return $templates; 191 } 192 193 /** 194 * Update the global $post with create screen data. 195 * 196 * @since BuddyPress (1.7.0) 197 */ 198 public function create_dummy_post() { 199 200 // Title based on ability to create blogs 201 if ( is_user_logged_in() && bp_blog_signup_enabled() ) { 202 $title = __( 'Create a Site', 'buddypress' ); 203 } else { 204 $title = __( 'Sites', 'buddypress' ); 205 } 145 206 146 207 bp_theme_compat_reset_post( array( … … 158 219 159 220 /** 160 * Filter the_content with the groups index template part.161 *162 * @since BuddyPress (1.7.0)163 */164 public function directory_content() {165 return bp_buffer_template_part( 'blogs/index', null, false );166 }167 168 /** Create ****************************************************************/169 170 /**171 * Add custom template hierarchy to theme compat for the blog create page.172 *173 * This is to mirror how WordPress has174 * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}.175 *176 * @since BuddyPress (1.8.0)177 *178 * @param string $templates The templates from179 * bp_get_theme_compat_templates().180 * @return array $templates Array of custom templates to look for.181 */182 public function create_template_hierarchy( $templates ) {183 // Setup our templates based on priority184 $new_templates = apply_filters( 'bp_template_hierarchy_blogs_create', array(185 'blogs/index-create.php'186 ) );187 188 // Merge new templates with existing stack189 // @see bp_get_theme_compat_templates()190 $templates = array_merge( (array) $new_templates, $templates );191 192 return $templates;193 }194 195 /**196 * Update the global $post with create screen data.197 *198 * @since BuddyPress (1.7.0)199 */200 public function create_dummy_post() {201 202 // Title based on ability to create blogs203 if ( is_user_logged_in() && bp_blog_signup_enabled() ) {204 $title = '<a class="button bp-title-button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) . '">' . __( 'Sites', 'buddypress' ) . '</a> ' . __( 'Create a Site', 'buddypress' );205 } else {206 $title = __( 'Sites', 'buddypress' );207 }208 209 bp_theme_compat_reset_post( array(210 'ID' => 0,211 'post_title' => $title,212 'post_author' => 0,213 'post_date' => 0,214 'post_content' => '',215 'post_type' => 'page',216 'post_status' => 'publish',217 'is_page' => true,218 'comment_status' => 'closed'219 ) );220 }221 222 /**223 221 * Filter the_content with the create screen template part. 224 222 *
Note: See TracChangeset
for help on using the changeset viewer.