Skip to content

Commit

Permalink
Update mail.php
Browse files Browse the repository at this point in the history
  • Loading branch information
takayukister committed Feb 12, 2023
1 parent 442d0f2 commit 4e2378f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions includes/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,13 @@ public function format( $original, $format ) {

return $original;
}

}


/**
* Class that represents a mail-tag.
*/
class WPCF7_MailTag {

private $tag;
Expand All @@ -568,6 +573,10 @@ class WPCF7_MailTag {
private $values = array();
private $form_tag = null;


/**
* The constructor method.
*/
public function __construct( $tag, $tagname, $values ) {
$this->tag = $tag;
$this->name = $this->tagname = $tagname;
Expand All @@ -593,22 +602,42 @@ public function __construct( $tag, $tagname, $values ) {
}
}


/**
* Returns the name part of this mail-tag.
*/
public function tag_name() {
return $this->tagname;
}


/**
* Returns the form field name corresponding to this mail-tag.
*/
public function field_name() {
return strtr( $this->name, '.', '_' );
}


/**
* Returns the value of the specified option.
*/
public function get_option( $option ) {
return $this->options[$option];
}


/**
* Returns the values part of this mail-tag.
*/
public function values() {
return $this->values;
}


/**
* Retrieves the WPCF7_FormTag object that corresponds to this mail-tag.
*/
public function corresponding_form_tag() {
if ( $this->form_tag instanceof WPCF7_FormTag ) {
return $this->form_tag;
Expand All @@ -628,4 +657,5 @@ public function corresponding_form_tag() {

return $this->form_tag;
}

}

0 comments on commit 4e2378f

Please sign in to comment.