invite_anyone_confliction_remove

The BuddyPress Global Search invite anyone confliction remove class.

Defined (1)

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

/includes/plugins/invite-anyone/index.php  
  1. class invite_anyone_confliction_remove { 
  2.  
  3. public function __construct() { 
  4. $this->hooks(); 
  5.  
  6. public function hooks() { 
  7. if( function_exists('invite_anyone_init') ) { 
  8. add_action( 'wp', array($this, 'remove_invite_anyone_js') ); 
  9.  
  10. function remove_invite_anyone_js() { 
  11. remove_action( 'wp_head', 'invite_anyone_add_js', 1 ); 
  12. add_action( 'wp_enqueue_scripts', array($this, 'invite_anyone_add_js') ); 
  13.  
  14. function invite_anyone_add_js() { 
  15.  
  16. global $bp; 
  17.  
  18. if ( $bp->current_action == BP_INVITE_ANYONE_SLUG || ( isset( $bp->action_variables[1] ) && $bp->action_variables[1] == BP_INVITE_ANYONE_SLUG ) ) { 
  19.  
  20. wp_dequeue_script('invite-anyone-autocomplete-js'); 
  21. wp_dequeue_script('invite-anyone-js'); 
  22.  
  23. $min = '-min'; 
  24. if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { 
  25. $min = ''; 
  26.  
  27. wp_enqueue_script( 'invite-anyone-autocomplete-js', buddyboss_global_search()->assets_url . "/js/invite-anyone/jquery.autocomplete$min.js", array( 'jquery' ) ); 
  28.  
  29. wp_register_script( 'invite-anyone-js', buddyboss_global_search()->assets_url . '/js/invite-anyone/group-invites-js.js', array( 'invite-anyone-autocomplete-js' ) ); 
  30. wp_enqueue_script( 'invite-anyone-js' ); 
  31.  
  32. // Add words that we need to use in JS to the end of the page 
  33. // so they can be translated and still used. 
  34. $params = apply_filters( 'ia_get_js_strings', array( 
  35. 'unsent_invites' => __( 'Click “Send Invites” to finish sending your new invitations.', 'buddypress-global-search' ),  
  36. ) ); 
  37. wp_localize_script( 'invite-anyone-js', 'IA_js_strings', $params ); 
  38.  
  39.