Inventory_Presser_Contact_Form_7::add_link( string $replaced, string $submitted, string $html, WPCF7_MailTag $mail_tag )

add_link


Description Description

Wraps strings like "2020 Toyota Sienna LE, 10329A" with a link in form submission emails.


Top ↑

Parameters Parameters

$replaced

(string) (Required)

$submitted

(string) (Required) "2020 Toyota Sienna LE, 10329A"

$html

(string) (Required)

$mail_tag

(WPCF7_MailTag) (Required)


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/integrations/class-contact-form-7.php

	public function add_link( $replaced, $submitted, $html, $mail_tag ) {
		//Allow HTML in emails
		add_filter( 'wp_mail_content_type', array( $this, 'html_mail_content_type' ) );

		$post_id = $this->extract_post_id_from_value( $submitted );
		if ( empty( $post_id ) ) {
			return $replaced;
		}

		return sprintf( '<a href="%s">%s</a>', get_permalink( $post_id ), $replaced );
	}