LLMS_Abstract_Generator_Posts::set_featured_image( string $url_or_raw, int $post_id )

Saves an image (from URL) to the media library and sets it as the featured image for a given post


Description Description


Parameters Parameters

$url_or_raw

(Required) Array of raw data or URL to an image.

$post_id

(Required) WP Post ID.


Top ↑

Return Return

(null|false|int) Returns null if sideloading is disabled, WP Post ID of the attachment on success, false on error.


Top ↑

Source Source

File: includes/abstracts/llms-abstract-generator-posts.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
4.7.0 Moved from LLMS_Generator and made protected instead of private. Add a return instead of void; Don't import if sideloading is disabled; Use $this->sideload_image() sideloading.
3.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.