LLMS_Abstract_Generator_Posts::sideload_image( int $post_id, string $url,  $return = 'src' )

Sideload an image from a url


Description Description


Parameters Parameters

$post_id

(Required) WP_Post ID of the post where the image will be attached.

$url

(Required) The image's URL.


Top ↑

Return Return

(string|int|WP_Error) Returns a WP_Error on failure, the image's new URL when $return is "src", otherwise returns the image's attachment ID.


Top ↑

Source Source

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


			

Top ↑

Changelog Changelog

Changelog
Version Description
4.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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