/1.5-abstraction.php

  1. <?php 
  2.  
  3. /** 
  4. * 1.5 functions 
  5. */ 
  6.  
  7. if ( !function_exists( 'bp_core_admin_hook' ) ) : 
  8. function bp_core_admin_hook() { 
  9. // Groupblog requires multisite, so we don't need any more logic 
  10. return apply_filters( 'bp_core_admin_hook', 'network_admin_menu' ); 
  11. endif; 
  12.  
  13. if ( !function_exists( 'bp_is_action_variable' ) ) : 
  14. function bp_is_action_variable( $value, $position = false ) { 
  15. global $bp; 
  16.  
  17. if ( false === $position ) { 
  18. $is_action_variable = !empty( $bp->action_variables ) && in_array( $value, $bp->action_variables ); 
  19. } else { 
  20. $is_action_variable = !empty( $bp->action_variables ) && isset( $bp->action_variables[$position] ) && $value == $bp->action_variables[$position]; 
  21.  
  22. return apply_filters( 'bp_is_action_variable', $is_action_variable ); 
  23. endif; 
  24.  
  25. if ( !function_exists( 'bp_is_current_action' ) ) : 
  26. function bp_is_current_action( $action ) { 
  27. global $bp; 
  28.  
  29. return apply_filters( 'bp_is_current_action', $action == $bp->current_action ); 
  30. endif; 
  31.  
  32. if ( !function_exists( 'bp_is_groups_component' ) ) : 
  33. function bp_is_groups_component() { 
  34. global $bp; 
  35.  
  36. return apply_filters( 'bp_is_groups_component', $bp->groups->slug == $bp->current_component ); 
  37. endif; 
  38.  
  39. if ( !function_exists( 'bp_is_forums_component' ) ) : 
  40. function bp_is_forums_component() { 
  41. global $bp; 
  42.  
  43. return apply_filters( 'bp_is_forums_component', $bp->forums->slug == $bp->current_component ); 
  44. endif; 
  45.  
  46. if ( !function_exists( 'groups_get_current_group' ) ) : 
  47. function groups_get_current_group() { 
  48. global $bp; 
  49.  
  50. return apply_filters( 'groups_get_current_group', !empty( $bp->groups->current_group ) ? $bp->groups->current_group : new stdClass ); 
  51. endif; 
  52.  
  53. if ( !function_exists( 'bp_get_current_group_id' ) ) : 
  54. function bp_get_current_group_id() { 
  55. global $bp; 
  56.  
  57. return apply_filters( 'bp_get_current_group_id', isset( $bp->groups->current_group->id ) ? $bp->groups->current_group->id : 0 ); 
  58. endif; 
  59.  
  60. if ( !function_exists( 'bp_is_user' ) ) : 
  61. function bp_is_user() { 
  62. return bp_is_member(); 
  63. endif; 
  64.  
  65. if ( !function_exists( 'bp_actions' ) ) : 
  66. function bp_actions() { 
  67. do_action( 'bp_actions' ); 
  68. add_action( 'wp', 'bp_actions', 1 ); 
  69. endif; 
  70.  
  71. ?> 
.