/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. if ( ! buddypress()->do_autoload ) { 
  14. require dirname( __FILE__ ) . '/classes/class-bp-blogs-theme-compat.php'; 
  15.  
  16. /** 
  17. * Load the "My Blogs" screen. 
  18. */ 
  19. function bp_blogs_screen_my_blogs() { 
  20. if ( !is_multisite() ) 
  21. return false; 
  22.  
  23. /** 
  24. * Fires right before the loading of the My Blogs screen template file. 
  25. * 
  26. * @since 1.0.0 
  27. */ 
  28. do_action( 'bp_blogs_screen_my_blogs' ); 
  29.  
  30. bp_core_load_template( apply_filters( 'bp_blogs_template_my_blogs', 'members/single/home' ) ); 
  31.  
  32. /** 
  33. * Load the "Create a Blog" screen. 
  34. */ 
  35. function bp_blogs_screen_create_a_blog() { 
  36.  
  37. if ( !is_multisite() || !bp_is_blogs_component() || !bp_is_current_action( 'create' ) ) 
  38. return false; 
  39.  
  40. if ( !is_user_logged_in() || !bp_blog_signup_enabled() ) 
  41. return false; 
  42.  
  43. /** 
  44. * Fires right before the loading of the Create A Blog screen template file. 
  45. * 
  46. * @since 1.0.0 
  47. */ 
  48. do_action( 'bp_blogs_screen_create_a_blog' ); 
  49.  
  50. bp_core_load_template( apply_filters( 'bp_blogs_template_create_a_blog', 'blogs/create' ) ); 
  51. add_action( 'bp_screens', 'bp_blogs_screen_create_a_blog', 3 ); 
  52.  
  53. /** 
  54. * Load the top-level Blogs directory. 
  55. */ 
  56. function bp_blogs_screen_index() { 
  57. if ( bp_is_blogs_directory() ) { 
  58. bp_update_is_directory( true, 'blogs' ); 
  59.  
  60. /** 
  61. * Fires right before the loading of the top-level Blogs screen template file. 
  62. * 
  63. * @since 1.0.0 
  64. */ 
  65. do_action( 'bp_blogs_screen_index' ); 
  66.  
  67. bp_core_load_template( apply_filters( 'bp_blogs_screen_index', 'blogs/index' ) ); 
  68. add_action( 'bp_screens', 'bp_blogs_screen_index', 2 ); 
  69.  
  70. /** Theme Compatibility *******************************************************/ 
  71.  
  72. new BP_Blogs_Theme_Compat(); 
.