Changeset 8408 for trunk/src/bp-blogs/bp-blogs-template.php
- Timestamp:
- 05/10/2014 01:37:05 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-blogs/bp-blogs-template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-template.php
r8407 r8408 672 672 /** 673 673 * Output the latest post from the current blog in the loop. 674 */ 675 function bp_blog_latest_post() { 676 echo bp_get_blog_latest_post(); 674 * 675 * @param array $args See {@link bp_get_blog_latest_post()}. 676 */ 677 function bp_blog_latest_post( $args = array() ) { 678 echo bp_get_blog_latest_post( $args ); 677 679 } 678 680 /** 679 681 * Return the latest post from the current blog in the loop. 680 682 * 683 * @param array $args { 684 * Array of optional arguments. 685 * @type bool $latest_format If true, formatted "Latest post: 686 * [link to post]". If false, formatted "[link to post]". 687 * Default: true. 688 * } 681 689 * @return string $retval String of the form 'Latest Post: [link to post]'. 682 690 */ 683 function bp_get_blog_latest_post( ) {691 function bp_get_blog_latest_post( $args = array() ) { 684 692 global $blogs_template; 685 693 694 $r = wp_parse_args( $args, array( 695 'latest_format' => true, 696 ) ); 697 686 698 $retval = bp_get_blog_latest_post_title(); 687 699 688 if ( ! empty( $retval ) ) 689 $retval = sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>' ); 700 if ( ! empty( $retval ) ) { 701 if ( ! empty( $r['latest_format'] ) ) { 702 $retval = sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>' ); 703 } else { 704 $retval = '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>'; 705 } 706 } 690 707 691 708 return apply_filters( 'bp_get_blog_latest_post', $retval );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)