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.
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.
Source Source
File: includes/abstracts/llms-abstract-generator-posts.php
Changelog Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |