bp_profile_private_message_ux_button

The BP Profile Message UX bp profile private message ux button function.

Description

bp_profile_private_message_ux_button( $button ); 

Parameters (1)

0. $button
The button.

Usage

  1. if ( !function_exists( 'bp_profile_private_message_ux_button' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bp-profile-message-ux/bp-profile-message-ux.php'; 
  3.  
  4. // The button. 
  5. $button = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_profile_private_message_ux_button($button); 
  9.  

Defined (1)

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

/bp-profile-message-ux.php  
  1. function bp_profile_private_message_ux_button( $button ) { 
  2.  
  3. if( !is_user_logged_in() || bp_is_my_profile() )  
  4. return; 
  5.  
  6. $button_divs = ''; 
  7.  
  8. $button_title = __('Send a private message to', 'bp-profile-message-ux'); 
  9. $button_label = __('Private Message', 'bp-profile-message-ux');  
  10. $send_button_label = __('Send Message', 'bp-profile-message-ux'); 
  11. $subject_label = __('Subject', 'bp-profile-message-ux'); 
  12. $message_label = __('Message', 'bp-profile-message-ux'); 
  13.  
  14. $button_divs .= '<div class="generic-button" id="send-private-message">'; 
  15.  
  16. $button_divs .= '<a href="#TB_inline?width=300&height=310&inlineId=create-private-message-ux" class="thickbox" id="private-button-id" title="'; 
  17.  
  18. $button_divs .= $button_title . ' ' . bp_get_displayed_user_username() . '">'; 
  19.  
  20. $button_divs .= $button_label . '</a></div>'; 
  21.  
  22. $button_divs .= '<div id="create-private-message-ux" style="display:none">'; 
  23.  
  24. $button_divs .= '<form action="' . bp_profile_message_ux_send_private_message() . '" name="private-message-form-ux" id="private-message-form-ux" method="post" class="standard-form">'; 
  25.  
  26. $button_divs .= '<label for="private_message_subject">' . $subject_label . '</label> '; 
  27.  
  28. $button_divs .= '<input type="text" size="41" maxlength="50" name="private_message_subject" id="private_message_subject" /><br /><br />'; 
  29.  
  30. $button_divs .= '<label for="private_message_content">' . $message_label . '</label><br />'; 
  31.  
  32. $button_divs .= '<textarea name="private_message_content" id="private_message_content" rows="10" cols="52"></textarea><br /><br />';  
  33.  
  34. $button_divs .= '<input type="hidden" name="private-message-hidden" value="1"/>'; 
  35.  
  36. $button_divs .= '<input name="private_message_send" id="private_message_send" type="submit" name="submit" class="button button-primary" value="'; 
  37.  
  38. $button_divs .= $send_button_label . '"/>' . wp_nonce_field( 'private_message_check' ) . '</form></div>'; 
  39.  
  40. return $button_divs; 
  41.