bp_get_blog_latest_post_permalink

Return the permalink of the latest post on the current blog in the loop.

Description

(string) bp_get_blog_latest_post_permalink(); 

Returns (string)

URL of the blog's latest post.


Usage

  1. if ( !function_exists( 'bp_get_blog_latest_post_permalink' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-blogs/bp-blogs-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_get_blog_latest_post_permalink(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-blogs/bp-blogs-template.php  
  1. function bp_get_blog_latest_post_permalink() { 
  2. global $blogs_template; 
  3.  
  4. $retval = ''; 
  5.  
  6. if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->ID ) ) 
  7. $retval = add_query_arg( 'p', $blogs_template->blog->latest_post->ID, bp_get_blog_permalink() ); 
  8.  
  9. /** 
  10. * Filters the permalink of the latest post on the current blog in the loop. 
  11. * @since 1.7.0 
  12. * @param string $retval Permalink URL of the latest post. 
  13. */