Car Demon Code Docs

  1. Home
  2. Car Demon Code Docs
  3. Display Filters
  4. cd_get_thumbnails

cd_get_thumbnails

This filter can be used to filter the vehicle thumbnails array.

The “type” parameter can be used to filter imported gallery images (media) or gallery images that are linked from a third party site (link).

The following example will reverse the order of the thumbnails:

function my_cd_get_thumbnails( $thumbnails, $post_id, $type ) {
    if ( is_array( $thumbnails ) ) { 
        $thumbnails = array_reverse( $thumbnails ); }
    return $thumbnails;
}
add_filter( 'cd_get_thumbnails', 'my_get_thumbnails', 10, 3 );
Was this article helpful to you? Yes No

How can we help?