/**
  * Get the array with the featured image url, width, and height (or false).
  */
 public function get_the_featured_image_src()
 {
     $this->ensure_setup();
     if (!is_null($this->featured_image_src)) {
         return $this->featured_image_src;
     }
     $this->featured_image_src = wp_get_attachment_image_src(get_post_thumbnail_id(), 'prompt-post-featured');
     if (Prompt_Admin_Delivery_Metabox::suppress_featured_image($this->post->ID)) {
         $this->featured_image_src = false;
     }
     return $this->featured_image_src;
 }
Пример #2
0
 /**
  * @param $post_id
  * @return array|bool
  */
 protected static function featured_image_src($post_id)
 {
     if (Prompt_Admin_Delivery_Metabox::suppress_featured_image($post_id)) {
         return false;
     }
     $featured_image = image_get_intermediate_size(get_post_thumbnail_id($post_id), 'prompt-post-featured');
     if (!$featured_image) {
         $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), 'full');
     }
     if (!$featured_image) {
         return false;
     }
     return array($featured_image['url'], $featured_image['width'], $featured_image['height']);
 }