Changeset 3922 for branches/plugin/bbp-includes/bbp-template-loader.php
- Timestamp:
- 05/30/2012 06:28:31 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-template-loader.php
r3743 r3922 46 46 function bbp_template_include_theme_supports( $template = '' ) { 47 47 48 // Bail if current theme does not support bbPress49 if ( !current_theme_supports( 'bbpress' ) )50 return $template;51 52 48 // Viewing a user 53 49 if ( bbp_is_single_user() && ( $new_template = bbp_get_single_user_template() ) ) : … … 59 55 elseif ( bbp_is_single_view() && ( $new_template = bbp_get_single_view_template() ) ) : 60 56 61 // Topic edit 57 // Single Forum 58 elseif ( bbp_is_single_forum() && ( $new_template = bbp_get_single_forum_template() ) ) : 59 60 // Forum Archive 61 elseif ( bbp_is_forum_archive() && ( $new_template = bbp_get_forum_archive_template() ) ) : 62 63 // Forum edit 62 64 elseif ( bbp_is_forum_edit() && ( $new_template = bbp_get_forum_edit_template() ) ) : 65 66 // Single Topic 67 elseif ( bbp_is_single_topic() && ( $new_template = bbp_get_single_topic_template() ) ) : 68 69 // Topic Archive 70 elseif ( bbp_is_topic_archive() && ( $new_template = bbp_get_topic_archive_template() ) ) : 63 71 64 72 // Topic merge … … 70 78 // Topic edit 71 79 elseif ( bbp_is_topic_edit() && ( $new_template = bbp_get_topic_edit_template() ) ) : 80 81 // Single Reply 82 elseif ( bbp_is_single_reply() && ( $new_template = bbp_get_single_reply_template() ) ) : 72 83 73 84 // Editing a reply … … 172 183 173 184 /** 185 * Get the single forum template 186 * 187 * @since bbPress (r3922) 188 * 189 * @uses bbp_get_forum_post_type() 190 * @uses bbp_get_query_template() 191 * @return string Path to template file 192 */ 193 function bbp_get_single_forum_template() { 194 $templates = array( 195 'single-' . bbp_get_forum_post_type() . '.php' // Single Forum 196 ); 197 return bbp_get_query_template( 'single_forum', $templates ); 198 } 199 200 /** 201 * Get the forum archive template 202 * 203 * @since bbPress (r3922) 204 * 205 * @uses bbp_get_forum_post_type() 206 * @uses bbp_get_query_template() 207 * @return string Path to template file 208 */ 209 function bbp_get_forum_archive_template() { 210 $templates = array( 211 'archive-' . bbp_get_forum_post_type() . '.php' // Forum Archive 212 ); 213 return bbp_get_query_template( 'forum_archive', $templates ); 214 } 215 216 /** 174 217 * Get the forum edit template 175 218 * … … 190 233 191 234 /** 235 * Get the single topic template 236 * 237 * @since bbPress (r3922) 238 * 239 * @uses bbp_get_topic_post_type() 240 * @uses bbp_get_query_template() 241 * @return string Path to template file 242 */ 243 function bbp_get_single_topic_template() { 244 $templates = array( 245 'single-' . bbp_get_topic_post_type() . '.php' 246 ); 247 return bbp_get_query_template( 'single_topic', $templates ); 248 } 249 250 /** 251 * Get the topic archive template 252 * 253 * @since bbPress (r3922) 254 * 255 * @uses bbp_get_topic_post_type() 256 * @uses bbp_get_query_template() 257 * @return string Path to template file 258 */ 259 function bbp_get_topic_archive_template() { 260 $templates = array( 261 'archive-' . bbp_get_topic_post_type() . '.php' // Topic Archive 262 ); 263 return bbp_get_query_template( 'topic_archive', $templates ); 264 } 265 266 /** 192 267 * Get the topic edit template 193 268 * … … 239 314 ); 240 315 return bbp_get_query_template( 'topic_merge', $templates ); 316 } 317 318 /** 319 * Get the single reply template 320 * 321 * @since bbPress (r3922) 322 * 323 * @uses bbp_get_reply_post_type() 324 * @uses bbp_get_query_template() 325 * @return string Path to template file 326 */ 327 function bbp_get_single_reply_template() { 328 $templates = array( 329 'single-' . bbp_get_reply_post_type() . '.php' 330 ); 331 return bbp_get_query_template( 'single_reply', $templates ); 241 332 } 242 333
Note: See TracChangeset
for help on using the changeset viewer.