[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/classes/ -> class-bp-email-participant.php (source)

   1  <?php
   2  /**
   3   * Base class for email "participants" (recipient, sender, Reply-To, etc).
   4   *
   5   * @since 5.0.0
   6   */
   7  
   8  abstract class BP_Email_Participant implements BP_Email_Address {
   9      /**
  10       * Recipient's email address.
  11       *
  12       * @since 5.0.0
  13       *
  14       * @var string
  15       */
  16      protected $address = '';
  17  
  18      /**
  19       * Recipient's name.
  20       *
  21       * @since 5.0.0
  22       *
  23       * @var string
  24       */
  25      protected $name = '';
  26  
  27      /**
  28       * Gets the email address of the user.
  29       *
  30       * @since 5.0.0
  31       */
  32  	public function get_address() {
  33          /**
  34           * Filters an email user's address before it's returned.
  35           *
  36           * @since 5.0.0
  37           *
  38           * @param string        $address User's address.
  39           * @param BP_Email_User $user    Current instance of the email user class.
  40           */
  41          return apply_filters( 'bp_email_user_get_address', $this->address, $this );
  42      }
  43  
  44      /**
  45       * Gets the email name of the user.
  46       *
  47       * @since 5.0.0
  48       *
  49       * @return string
  50       */
  51  	public function get_name() {
  52          /**
  53           * Filters an email user's name before it's returned.
  54           *
  55           * @since 5.0.0
  56           *
  57           * @param string        $name Recipient's name.
  58           * @param BP_Email_User $user Current instance of the email user class.
  59           */
  60          return apply_filters( 'bp_email_recipient_get_name', $this->name, $this );
  61      }
  62  
  63      /**
  64       * Sets the email address of the user.
  65       *
  66       * @since 5.0.0
  67       *
  68       * @param string $email_address Email address.
  69       */
  70  	public function set_address( $email_address ) {
  71          $this->address = $email_address;
  72      }
  73  
  74      /**
  75       * Sets the name of the user.
  76       *
  77       * @since 5.0.0
  78       *
  79       * @param string $name Name.
  80       */
  81  	public function set_name( $name ) {
  82          $this->name = $name;
  83      }
  84  }


Generated: Sun Nov 24 01:00:53 2024 Cross-referenced by PHPXref 0.7.1