cptbc_get_featured_image

The CPT Bootstrap Carousel cptbc get featured image function.

Description

cptbc_get_featured_image( $post_ID ); 

Parameters (1)

0. $post_id
The post ID.

Usage

  1. if ( !function_exists( 'cptbc_get_featured_image' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'cpt-bootstrap-carousel/cptbc-admin.php'; 
  3.  
  4. // The post ID. 
  5. $post_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = cptbc_get_featured_image($post_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/cptbc-admin.php  
  1. function cptbc_get_featured_image($post_ID) {  
  2. $post_thumbnail_id = get_post_thumbnail_id($post_ID);  
  3. if ($post_thumbnail_id) {  
  4. $post_thumbnail_img = wp_get_attachment_image_src($post_thumbnail_id, 'featured_preview');  
  5. return $post_thumbnail_img[0];  
  6. }