Adds return of different sizes of thumbnails

This commit is contained in:
weryques 2018-05-21 16:22:05 -03:00
parent c410b3cfa8
commit 14c67619b3
2 changed files with 16 additions and 4 deletions

View File

@ -206,10 +206,16 @@ class Collection extends Entity {
} }
/** /**
* @return false|string * @return array
*/ */
function get_thumbnail() { function get_thumbnail() {
return get_the_post_thumbnail_url( $this->get_id(), 'full' ); return array(
'thumb' => get_the_post_thumbnail_url( $this->get_id(), 'post-thumbnail' ),
'full' => get_the_post_thumbnail_url( $this->get_id(), 'full' ),
'medium' => get_the_post_thumbnail_url( $this->get_id(), 'medium' ),
'medium_large' => get_the_post_thumbnail_url( $this->get_id(), 'medium_large' ),
'large' => get_the_post_thumbnail_url( $this->get_id(), 'large' ),
);
} }
/** /**

View File

@ -126,10 +126,16 @@ class Item extends Entity {
} }
/** /**
* @return false|string * @return array
*/ */
function get_thumbnail() { function get_thumbnail() {
return get_the_post_thumbnail_url( $this->get_id(), 'full' ); return array(
'thumb' => get_the_post_thumbnail_url( $this->get_id(), 'post-thumbnail' ),
'full' => get_the_post_thumbnail_url( $this->get_id(), 'full' ),
'medium' => get_the_post_thumbnail_url( $this->get_id(), 'medium' ),
'medium_large' => get_the_post_thumbnail_url( $this->get_id(), 'medium_large' ),
'large' => get_the_post_thumbnail_url( $this->get_id(), 'large' ),
);
} }
/** /**