Inventory_Presser_Email_A_Friend::url( WP_Post $post )
url
Contents
Description Description
Creates a mailto: url to draft an email containing vehicle information.
Parameters Parameters
- $post
-
(WP_Post) (Required) a post object of type inventory_vehicle
Return Return
(string)
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