ihordeveloper

Thanks, you can help improve HivePress and speed up the development by donating any amount via PayPal. This code snippet adds %listing_url% token to the attribute display format:

add_filter(
	'hivepress/v1/models/listing/fields',
	function( $fields, $listing ) {
		foreach ( $fields as $name => $field ) {
			if ( isset( $field['display_template'] ) && strpos( $field['display_template'], '%listing_url%' ) !== false ) {
				$fields[ $name ]['display_template'] = str_replace( '%listing_url%', get_permalink( $listing->get_id() ), $field['display_template'] );
			}
		}

		return $fields;
	},
	1000,
	2
);

So it’s possible to use it in the “mailto” link, for example by setting it as the email content https://stackoverflow.com/questions/4782068/can-i-set-subject-content-of-email-using-mailto

Subscribe

Sign In

Don't have an account? Register

Forgot password?

Register

Already have an account? Sign In

Forgot password?

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.

Cyber Monday is here! Get 25% off with MONDAY2020 coupon code until Monday, December 7.