invp_get_the_transmission( $post_ID = null )


Source Source

File: includes/template-tags.php

function invp_get_the_transmission( $post_ID = null )
{
	if( empty( $post_ID ) )
	{
		$post_ID = get_the_ID();
	}
	$raw = INVP::get_meta( 'transmission', $post_ID );

	/**
	 * If we have transmission speeds "6" and transmission string 
	 * "Automatic", change the string to "6 Speed Automatic"
	 */
	if( ! empty( invp_get_the_transmission_speeds( $post_ID ) ) )
	{
		$prefix = sprintf(
			'%s %s',
			invp_get_the_transmission_speeds( $post_ID ),
			__( 'Speed', 'inventory-presser' )
		);

		if( false === strpos( $raw, $prefix ) )
		{
			$raw = sprintf(
				'%s %s',
				$prefix,
				$raw
			);
		}
	}

	return $raw;