Changeset 6374
- Timestamp:
- 10/01/2012 09:04:40 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/bp-blogs/bp-blogs-template.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-template.php
r6372 r6374 31 31 */ 32 32 function bp_get_blogs_slug() { 33 global $bp; 34 return apply_filters( 'bp_get_blogs_slug', $bp->blogs->slug ); 33 return apply_filters( 'bp_get_blogs_slug', buddypress()->blogs->slug ); 35 34 } 36 35 … … 55 54 */ 56 55 function bp_get_blogs_root_slug() { 57 global $bp; 58 return apply_filters( 'bp_get_blogs_root_slug', $bp->blogs->root_slug ); 56 return apply_filters( 'bp_get_blogs_root_slug', buddypress()->blogs->root_slug ); 59 57 } 60 58 … … 357 355 global $blogs_template; 358 356 359 if ( null == $blogs_template->blog->latest_post ) 360 return false; 361 362 return apply_filters( 'bp_get_blog_latest_post', sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $blogs_template->blog->latest_post->post_title ) . '</a>' ) ); 357 $retval = bp_get_blog_latest_post_title(); 358 359 if ( ! empty( $retval ) ) 360 $retval = sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>' ); 361 362 return apply_filters( 'bp_get_blog_latest_post', $retval ); 363 363 } 364 364 … … 366 366 * Prints this site's latest article's title 367 367 * 368 * @since BuddyPress (1.7) 369 * 368 370 * @see bp_get_blog_latest_post_title() 369 * @since BuddyPress (1.7)370 371 */ 371 372 function bp_blog_latest_post_title() { … … 375 376 * Returns this site's latest article's title 376 377 * 378 * @since BuddyPress (1.7) 379 * 377 380 * @global BP_Blogs_Template 378 381 * @return string 379 * @since BuddyPress (1.7)380 382 */ 381 383 function bp_get_blog_latest_post_title() { 382 384 global $blogs_template; 383 385 384 if ( empty( $blogs_template->blog->latest_post ) ) 385 return ''; 386 387 return apply_filters( 'bp_get_blog_latest_post_title', $blogs_template->blog->latest_post->post_title ); 386 $retval = ''; 387 388 if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->post_title ) ) 389 $retval = $blogs_template->blog->latest_post->post_title; 390 391 return apply_filters( 'bp_get_blog_latest_post_title', $retval ); 388 392 } 389 393 … … 391 395 * Prints this site's latest article's content 392 396 * 393 * @see bp_get_blog_latest_post_content()394 397 * @since BuddyPress (1.7) 398 * 399 * @uses bp_get_blog_latest_post_content() 395 400 */ 396 401 function bp_blog_latest_post_content() { 397 $content = bp_get_blog_latest_post_content(); 398 $content = apply_filters( 'bp_blog_latest_post_content', $content ); 399 $content = str_replace( ']]>', ']]>', $content ); 400 echo $content; 402 echo bp_get_blog_latest_post_content(); 401 403 } 402 404 /** 403 405 * Returns this site's latest article's content 404 406 * 407 * @since BuddyPress (1.7) 408 * 405 409 * @global BP_Blogs_Template 406 410 * @return string 407 * @since BuddyPress (1.7)408 411 */ 409 412 function bp_get_blog_latest_post_content() { 410 413 global $blogs_template; 411 414 412 if ( empty( $blogs_template->blog->latest_post ) ) 413 return ''; 414 415 return apply_filters( 'bp_get_blog_latest_post_content', $blogs_template->blog->latest_post->post_content ); 415 $retval = ''; 416 417 if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->post_content ) ) 418 $retval = $blogs_template->blog->latest_post->post_content; 419 420 return apply_filters( 'bp_get_blog_latest_post_content', $retval ); 416 421 } 417 422 418 423 /** 419 424 * Prints this site's latest article's featured image 425 * 426 * @since BuddyPress (1.7) 420 427 * 421 428 * @param string $size Image version to return. Either "thumbnail", "medium", "large", "post-thumbnail". 422 429 * @see bp_get_blog_latest_post_content() 423 * @since BuddyPress (1.7)424 430 */ 425 431 function bp_blog_latest_post_featured_image( $size = 'thumbnail' ) { … … 428 434 /** 429 435 * Returns this site's latest article's featured image 436 * 437 * @since BuddyPress (1.7) 430 438 * 431 439 * @global BP_Blogs_Template 432 440 * @param string $size Image version to return. Either "thumbnail", "medium", "large", "post-thumbnail". 433 441 * @return string 434 * @since BuddyPress (1.7)435 442 */ 436 443 function bp_get_blog_latest_post_featured_image( $size = 'thumbnail' ) { 437 444 global $blogs_template; 438 445 439 if ( empty( $blogs_template->blog->latest_post->images[$size] ) ) 440 return ''; 441 442 return apply_filters( 'bp_get_blog_latest_post_featured_image', $blogs_template->blog->latest_post->images[$size] ); 446 $retval = ''; 447 448 if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->images[$size] ) ) 449 $retval = $blogs_template->blog->latest_post->images[$size]; 450 451 return apply_filters( 'bp_get_blog_latest_post_featured_image', $retval ); 443 452 } 444 453 … … 685 694 686 695 <?php 696 697 // @todo where does $current_tab come from? 687 698 do_action( 'bp_blogs_blog_tabs', $current_tab ); 688 699 }
Note: See TracChangeset
for help on using the changeset viewer.