bp_profile_public_message_ux_button

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

Description

bp_profile_public_message_ux_button( $button ); 

Parameters (1)

0. $button
The button.

Usage

  1. if ( !function_exists( 'bp_profile_public_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_public_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_public_message_ux_button( $button ) { 
  2. global $bp; 
  3.  
  4. if( !is_user_logged_in() || bp_is_my_profile() )  
  5. return; 
  6.  
  7.  
  8. $button_title = __('Send a public message to', 'bp-profile-message-ux'); 
  9. $button_label = __('Public Message', 'bp-profile-message-ux');  
  10. $send_button_label = __('Send Message', 'bp-profile-message-ux'); 
  11. $message_label = __('Message', 'bp-profile-message-ux');  
  12.  
  13. $button_divs = ''; 
  14.  
  15. $button_divs .= '<div class="generic-button" id="send-public-message">';  
  16.  
  17. $button_divs .= '<a href="#TB_inline?width=300&height=225&inlineId=create-public-message-ux" class="thickbox" id="public-button-id" title="'; 
  18.  
  19. $button_divs .= $button_title . ' ' . bp_get_displayed_user_username() . '">'; 
  20.  
  21. $button_divs .= $button_label . '</a></div>';  
  22.  
  23. $button_divs .= '<div id="create-public-message-ux" style="display:none">';  
  24.  
  25. $button_divs .= '<form action="' . bp_profile_message_ux_send_public_message() . '" name="public-message-form-ux" id="public-message-form-ux" method="post" class="standard-form">'; 
  26.  
  27. $button_divs .= '<label for="public_message_content">' . $message_label . '</label><br />';  
  28.  
  29. $button_divs .= '<textarea name="whats-new-profile-ux" id="whats-new-profile-ux" cols="52" rows="10">'; 
  30.  
  31. $button_divs .= '@' . $bp->displayed_user->userdata->user_login . '</textarea><br />'; 
  32.  
  33. $button_divs .= '<input type="hidden" name="public-message-hidden" value="1"/>'; 
  34.  
  35. $button_divs .= '<input name="public_message_send" id="public_message_send" type="submit" name="submit" class="button button-primary" value="'; 
  36.  
  37. $button_divs .= $send_button_label . '"/>' . wp_nonce_field( 'public_message_check' ) . '</form></div>'; 
  38.  
  39. echo $button_divs; 
  40. //return $button_divs; 
  41. return NULL; 
  42.