Import media from a specific URL, saving as an attachment

Function Definition

function pods_attachment_import ( $url, $post_parent = null, $featured = false )

Source File: /pods/includes/media.php , Since 2.3

Parameters

PARAMETER TYPE DETAILS
$url (string) URL to media for import
$post_parent (int) ID of post parent, default none
$featured (boolean) Whether to set it as the featured (post thumbnail) of the post parent

Returns

(int) Attachment ID

Example