public static function get_timber_image( $timber_image ) {
		if ( is_numeric( $timber_image ) ) {
			$timber_image = new Timber\Image( $timber_image );

		// Convert an ACF image array into a Timber image
		} elseif ( is_array( $timber_image ) && isset( $timber_image['ID'] ) ) {
			$timber_image = new Timber\Image( $timber_image['ID'] );
		}

		// Check if non-empty TimberImage was found before returning it
		if ( ! $timber_image instanceof Timber\Image
			|| ! isset( $timber_image->post_type )
			|| 'attachment' !== $timber_image->post_type
		) {
			return false;
		}

		return $timber_image;
	}
public static function get_timber_image( $timber_image ) {
		if ( is_numeric( $timber_image ) ) {
			$timber_image = new Timber\Image( $timber_image );

		// Convert an ACF image array into a Timber image
		} elseif ( is_array( $timber_image ) && isset( $timber_image['ID'] ) ) {
			$timber_image = new Timber\Image( $timber_image['ID'] );
		}

		// Check if non-empty TimberImage was found before returning it
		if ( ! $timber_image instanceof Timber\Image
			|| ! isset( $timber_image->post_type )
			|| 'attachment' !== $timber_image->post_type
		) {
			return false;
		}

		return $timber_image;
	}
public static function get_timber_image ( $ timber_image ) { if ( is_numeric ( $ timber_image ) ) { $ timber_image = new Timber \ Image ( $ timber_image ) ; // Convert an ACF image array into a Timber image } elseif ( is_array ( $ timber_image ) && isset ( $ timber_image [ 'ID' ] ) ) { $ timber_image = new Timber \ Image ( $ timber_image [ 'ID' ] ) ; } // Check if non-empty TimberImage was found before returning it if ( ! $ timber_image instanceof Timber \ Image || ! isset ( $ timber_image -> post_type ) || 'attachment' !== $ timber_image -> post_type ) { return false ; } return $ timber_image ; }
Convert an image into a TimberImage.

@param mixed $timber_image The ID of the image, an array containing an ID key or an instance
of Timber\Image.

@return mixed              Instance of Timber\Image.
Convert an image into a TimberImage .