Tribe__Repository::set_featured_image( string|int $image )

Sets the create args the repository will use to create posts.


Parameters

$image

(string|int) (Required) The path to an image file, an image URL, or an attachment post ID.


Top ↑

Return

($this)


Top ↑

Source

File: src/Tribe/Repository.php

	public function set_featured_image( $image ) {
		if ( '' === $image || false === $image ) {
			$thumbnail_id = false;
		} elseif ( 0 === $image || null === $image ) {
			$thumbnail_id = '';
		} else {
			$thumbnail_id = tribe_upload_image( $image );
		}

		if ( false === $thumbnail_id ) {
			return $this;
		}

		return $this->set( '_thumbnail_id', $thumbnail_id );
	}

Top ↑

Changelog

Changelog
Version Description
4.9.5 Introduced.