/bp-blogs/bp-blogs-screens.php

  1. <?php 
  2. /** 
  3. * BuddyPress Blogs Screens. 
  4. * 
  5. * @package BuddyPress 
  6. * @subpackage BlogsScreens 
  7. * @since 1.5.0 
  8. */ 
  9.  
  10. // Exit if accessed directly. 
  11. defined( 'ABSPATH' ) || exit; 
  12.  
  13. /** 
  14. * Load the "My Blogs" screen. 
  15. */ 
  16. function bp_blogs_screen_my_blogs() { 
  17. if ( !is_multisite() ) 
  18. return false; 
  19.  
  20. /** 
  21. * Fires right before the loading of the My Blogs screen template file. 
  22. * 
  23. * @since 1.0.0 
  24. */ 
  25. do_action( 'bp_blogs_screen_my_blogs' ); 
  26.  
  27. bp_core_load_template( apply_filters( 'bp_blogs_template_my_blogs', 'members/single/home' ) ); 
  28.  
  29. /** 
  30. * Load the "Create a Blog" screen. 
  31. */ 
  32. function bp_blogs_screen_create_a_blog() { 
  33.  
  34. if ( !is_multisite() || !bp_is_blogs_component() || !bp_is_current_action( 'create' ) ) 
  35. return false; 
  36.  
  37. if ( !is_user_logged_in() || !bp_blog_signup_enabled() ) 
  38. return false; 
  39.  
  40. /** 
  41. * Fires right before the loading of the Create A Blog screen template file. 
  42. * 
  43. * @since 1.0.0 
  44. */ 
  45. do_action( 'bp_blogs_screen_create_a_blog' ); 
  46.  
  47. bp_core_load_template( apply_filters( 'bp_blogs_template_create_a_blog', 'blogs/create' ) ); 
  48. add_action( 'bp_screens', 'bp_blogs_screen_create_a_blog', 3 ); 
  49.  
  50. /** 
  51. * Load the top-level Blogs directory. 
  52. */ 
  53. function bp_blogs_screen_index() { 
  54. if ( bp_is_blogs_directory() ) { 
  55. bp_update_is_directory( true, 'blogs' ); 
  56.  
  57. /** 
  58. * Fires right before the loading of the top-level Blogs screen template file. 
  59. * 
  60. * @since 1.0.0 
  61. */ 
  62. do_action( 'bp_blogs_screen_index' ); 
  63.  
  64. bp_core_load_template( apply_filters( 'bp_blogs_screen_index', 'blogs/index' ) ); 
  65. add_action( 'bp_screens', 'bp_blogs_screen_index', 2 ); 
  66.  
  67. /** Theme Compatibility *******************************************************/ 
  68.  
  69. new BP_Blogs_Theme_Compat(); 
.