invp_get_the_photo_count( int|null $post_ID = null )
Template tag. Returns the number of images attached to the vehicle post.
On This Page
Description Description
Includes photos that do not yet have the vehicle photo post meta values.
Parameters Parameters
- $post_ID
-
(int|null) (Optional) The post ID of a vehicle. Must be passed when using this method outside the loop.
Default value: null
Return Return
(int)
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 count( get_children( array( 'post_mime_type' => 'image', 'post_parent' => $post_ID, 'post_type' => 'attachment', 'posts_per_page' => apply_filters( 'invp_query_limit', 1000, __FUNCTION__ ), ) ) ); }
Expand full source codeCollapse full source codeView on Github