Inventory PresserCar dealer WordPress plugin
  • Plugins
  • Documentation
    • Feature List
    • Screenshots
    • Theme Compatibility
    • Importing Vehicles
    • Vehicle Post Type
    • Widgets
    • Shortcodes
    • Template Tags
    • Hooks
  • Sample Sites
  • About
    • About us
    • News
    • Contact us
Home / Documentation / Classes / Inventory_Presser_Email_A_Friend / Inventory_Presser_Email_A_Friend::url()

Inventory_Presser_Email_A_Friend::url( WP_Post $post )

url

Contents

  • Description
  • Parameters
  • Return
  • Source
  • Related
    • Used By

Description #Description

Creates a mailto: url to draft an email containing vehicle information.


Top ↑

Parameters #Parameters

$post

(WP_Post) (Required) a post object of type inventory_vehicle


Top ↑

Return #Return

(string)


Top ↑

Source #Source

File: includes/class-menu-item-email-a-friend.php

	public function url( $post ) {

		if( ! isset( $post->post_title ) ) {
			return '';
		}

		$subject = 'Check out this ' . $post->post_title;
		$body = sprintf(
			'Please look at this %s for sale at %s:

%s',
			$post->post_title,
			html_entity_decode( get_bloginfo(), ENT_QUOTES ), //WordPress encodes quotes in site names
			get_permalink( $post )
		);
		return sprintf(
			'mailto:?subject=%s&body=%s',
			rawurlencode( htmlspecialchars_decode( $subject ) ),
			rawurlencode( htmlspecialchars_decode( $body ) )
		);
	}

Expand full source code Collapse full source code View on Github


Top ↑

Related #Related

Used By #Used By

Used By
Used By Description
includes/class-menu-item-email-a-friend.php: Inventory_Presser_Email_A_Friend::maybe_change_link()

maybe_change_link

Plugins
  • Inventory Presser
  • VIN Decoder
  • Elementor Add-on
  • Vehicle Filters Widget
  • View all Plugins→
Support
  • Documentation
  • Contact
About Us
  • News
  • Our Team
Search
Recent Posts
  • Blocks Preview Plugin Available
  • Inventory Presser is Free and Open Source
  • Inventory Presser integrates CarStory Market reports

© 2022 a Friday Systems product powered by WordPress