bp_registration_hide_ui

Hide BP posting UI components for private networks.

Description

bp_registration_hide_ui(); 

Usage

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

Defined (1)

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

/includes/core.php  
  1. function bp_registration_hide_ui() { 
  2.  
  3. $user = get_current_user_id(); 
  4. $moderate = (bool) get_option( 'bprwg_moderate' ); 
  5.  
  6. if ( empty( $moderate ) || ! $moderate ) { 
  7. return; 
  8. if ( absint( $count ) ) { 
  9.  
  10. return; 
  11.  
  12. remove_action( 'bp_directory_members_actions', 'bp_member_add_friend_button' ); 
  13.  
  14. add_filter( 'bp_activity_can_favorite', '__return_false' ); 
  15. // Hide friend buttons. 
  16. add_filter( 'bp_get_add_friend_button', '__return_empty_array' ); 
  17. add_filter( 'bp_get_send_public_message_button', '__return_empty_array' ); 
  18. add_filter( 'bp_get_send_message_button', '__return_false' ); 
  19. add_filter( 'bp_get_send_message_button_args', '__return_empty_array' ); 
  20.  
  21. // Hide group buttons. 
  22. add_filter( 'bp_user_can_create_groups', '__return_false' ); 
  23. add_filter( 'bp_get_group_join_button', '__return_empty_string' ); 
  24. add_filter( 'bp_get_group_create_button', '__return_empty_array' ); 
  25.  
  26. // Hide activity comment buttons. 
  27. add_filter( 'bp_activity_can_comment_reply', '__return_false' ); 
  28. add_filter( 'bp_activity_can_comment', '__return_false' ); 
  29. add_filter( 'bp_acomment_name', '__return_false' ); 
  30. add_filter( 'bp_get_activity_delete_link', '__return_empty_string' ); 
  31.  
  32. add_filter( 'bbp_current_user_can_access_create_reply_form', '__return_false' ); 
  33. add_filter( 'bbp_current_user_can_access_create_topic_form', '__return_false' ); 
  34. add_filter( 'bbp_get_topic_reply_link', '__return_empty_string' ); 
  35. add_filter( 'bbp_get_user_subscribe_link', '__return_empty_string' ); 
  36. add_filter( 'bbp_get_user_favorites_link', '__return_empty_string' ); 
  37.  
  38.