bp_get_messages_username_value

Get the default username for the recipient box.

Description

(string) bp_get_messages_username_value(); 

Returns (string)


Usage

  1. if ( !function_exists( 'bp_get_messages_username_value' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-messages/bp-messages-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_get_messages_username_value(); 
  7.  

Defined (1)

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

/bp-messages/bp-messages-template.php  
  1. function bp_get_messages_username_value() { 
  2. if ( isset( $_COOKIE['bp_messages_send_to'] ) ) { 
  3.  
  4. /** 
  5. * Filters the default username for the recipient box. 
  6. * Value passed into filter is dependent on if the 'bp_messages_send_to' 
  7. * cookie or 'r' $_GET parameter is set. 
  8. * @since 1.0.0 
  9. * @param string $value Default user name. 
  10. */ 
  11. return apply_filters( 'bp_get_messages_username_value', $_COOKIE['bp_messages_send_to'] ); 
  12. } elseif ( isset( $_GET['r'] ) && !isset( $_COOKIE['bp_messages_send_to'] ) ) { 
  13. /** This filter is documented in bp-messages-template.php */