- This topic has 5 replies, 2 voices, and was last updated 3 years, 10 months ago by
Nayeem Riddhi.
Hello sir,
I’m creating wpdm package by using WPDM()->package::create via PHP. There are few values which I’m not able to enter, Can you please help me ?
1. How can I add a Link for download via ‘files’ ► array() ?
2. What value should I enter to make the file accessible to all in ‘access’ ► ” ?
3. Why ‘post_name’ not working as I want to set a custom URL.
Please help as I’ve tried a lot but nothing worked.
Hello Sumit,
Hope you are well. Can you please check this doc for your requirements,
https://www.wpdownloadmanager.com/doc/function-reference/
and this too,
https://www.wpdownloadmanager.com/doc/action-reference/
I hope this may help you.
Thank you and regards
Sir, there is no function mentioned in these references about how can I attach a link while creating a package via PHP.
Hello Sumit,
We have also an add-on called Download Manager REST API that will help you create packages,
Can you please check this too, if it fulfills your requirements? and how you are trying to attach a link, in the frontend or backend section, please elaborate on this.
Thank you and regards
I’m using this to create wpdm package via PHP
WPDM()->package::create([
‘post_title’ ► ‘Download’,
‘post_name’ ► ”,
‘post_content’ ► ”,
‘post_excerpt’ ► ”,
‘post_status’ ► ‘publish’,
‘post_type’ ► ‘wpdmpro’,
‘post_author’ ► 1,
‘ping_status’ ► get_option(‘default_ping_status’),
‘post_parent’ ► 0,
‘menu_order’ ► 0,
‘to_ping’ ► ”,
‘pinged’ ► ”,
‘post_password’ ► ”,
‘guid’ ► ”,
‘post_content_filtered’ ► ”,
‘files’ ► array(),
‘fileinfo’ ► array(),
‘package_dir’ ► ”,
‘link_label’ ► __(“Download”, “download-manager”),
‘download_count’ ► 0,
‘view_count’ ► 0,
‘version’ ► ”,
‘stock’ ► 0,
‘package_size’ ► $size,
‘package_size_b’ ► 0,
‘access’ ► ”,
‘individual_file_download’ ► -1,
‘cache_zip’ ► -1,
‘template’ ► ‘page-template-doc-preview.php’,
‘page_template’ ► ‘page-template-doc-preview.php’,
‘password_lock’ ► ‘0’,
’email_lock’ ► ‘0’,
‘icon’ ► ”,
]);
I want to know how can I add link to download, File access to ‘All Visitors’ and set Custom Page URL via post_name. I’m stuck in these 3 things only.
Hello Sumit,
Does the above function/code-snippet is working fine without the 3 options from your side? please let me know
Thank you and regards
The topic "WPDM Package Create Question" is closed to new replies.