Programmatically get file path from id

Hello, I’m a developer and I’m writing some code to dynamically add a Download Monitor file to an Elementor form email message, as attachment, using the file id.

Following documentation on plugin website, I was able to retrieve the url of a download by its id, with this code:

$file_id=1218;
$file = download_monitor()->service( 'download_repository' )->retrieve_single( $file_id );
$fileurl = $file->post->guid;

How can I retrieve the file’s full local path?

  • This topic was modified 1 hour, 4 minutes ago by Mad Max.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer