groupblog_screen_blog

Groupblog_screen_blog().

Description

groupblog_screen_blog(); 

This screen gets called when the group blog link is clicked.


Usage

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

Defined (1)

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

/bp-groupblog.php  
  1. function groupblog_screen_blog() { 
  2.  
  3.  
  4. $checks = get_site_option('bp_groupblog_blog_defaults_options'); 
  5. $blog_id = get_groupblog_blog_id(); 
  6.  
  7. $home_url = ! empty( $blog_id ) ? get_home_url( get_groupblog_blog_id() ) : false; 
  8.  
  9. if ( isset( $checks['redirectblog'] ) && $checks['redirectblog'] == 1 && ! empty( $home_url ) ) { 
  10. wp_redirect( $home_url ); 
  11. die(); 
  12.  
  13. } else if ( isset( $checks['redirectblog'] ) && $checks['redirectblog'] == 2 && ! empty( $home_url ) ) { 
  14. wp_redirect( $home_url . '/' . $checks['pageslug'] . '/' ); 
  15. die(); 
  16.  
  17. } else { 
  18. if ( file_exists( locate_template( array( 'groupblog/blog.php' ) ) ) ) { 
  19. bp_core_load_template( apply_filters( 'groupblog_screen_blog', 'groupblog/blog' ) ); 
  20. add_action( 'bp_screens', 'groupblog_screen_blog' ); 
  21. else { 
  22. bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'groups/single/plugins' ) );