invp_get_the_photo_count( int $post_ID = null )

invp_get_the_photo_count


Description Description

Template tag. Returns the number of images attached to the vehicle post.


Top ↑

Parameters Parameters

$post_ID

(int) (Optional)

Default value: null


Top ↑

Return Return

(int)


Top ↑

Source Source

File: includes/template-tags.php

function invp_get_the_photo_count( $post_ID = null )
{
	if( empty( $post_ID ) )
	{
		$post_ID = get_the_ID();
	}

	return sizeof( get_children( array( 
		'post_mime_type' => 'image',
		'post_parent'    => $post_ID,
		'post_type'      => 'attachment',
		'posts_per_page' => -1,
	) ) );
}