I can’t believe there is no support for this bug yet!
Hey everyone – just a heads up, I have a work around for this bug. In your template (for example: /wp-content/themes/yourtheme/download-manager/page-templates/product.php)
Edit your code by adding “download” as described here.
<a class="btn" href="[download_url]" download>DOWNLOAD FILE <i class="fa fa-download" ></i></a>
No.
The “Open in Browser” box not checked. It never has been checked.
PLEASE NOTE: Your demo has the same bug: https://demo.wpdownloadmanager.com/wpdmpro/download/appshop/
oh wow. :/
I’ve contacted customizations and it was no help.
My code is:
function bhc_create_package($package_data){
if(isset($package_data['post_type']))
unset($package_data['post_type']);
$package_data_core = array(
'post_title' ► '',
'post_content' ► '',
'post_excerpt' ► '',
'post_status' ► 'publish',
'post_type' ► 'wpdmpro',
'post_author' ► get_current_user_id(),
'ping_status' ► get_option('default_ping_status'),
'post_parent' ► 0,
'menu_order' ► 0,
'to_ping' ► '',
'pinged' ► '',
'post_password' ► '',
'guid' ► '',
'post_content_filtered' ► '',
'import_id' ► 0
);
$package_data_meta = array(
'files' ► array(),
'fileinfo' ► array(),
'package_dir' ► '',
'link_label' ► __('Download','wpdmpro'),
'download_count' ► 0,
'view_count' ► 0,
'version' ► '1.0.0',
'stock' ► 0,
'package_size' ► 0,
'package_size_b' ► 0,
'access' ► 0,
'individual_file_download' ► -1,
'cache_zip' ► -1,
'template' ► 'product.php',
'page_template' ► '5a5bcb3d9a457',
'password_lock' ► '0',
'facebook_lock' ► '0',
'gplusone_lock' ► '0',
'linkedin_lock' ► '0',
'tweet_lock' ► '0',
'email_lock' ► '0',
'icon' ► '',
'import_id' ► 0
);
foreach($package_data_core as $key ► &$value){
$value = isset($package_data[$key])?$package_data[$key]:$package_data_core[$key];
}
if(!isset($package_data['ID']))
$post_id = wp_insert_post($package_data_core);
else {
$post_id = $package_data['ID'];
$package_data_core['ID'] = $post_id;
wp_update_post($package_data_core);
}
foreach($package_data_meta as $key ► $value){
$value = isset($package_data[$key])?$package_data[$key]:$package_data_meta[$key];
update_post_meta($post_id, '__wpdm_'.$key, $value);
}
if(isset($package_data['cats']))
wp_set_post_terms( $post_id, $package_data['cats'], 'wpdmcategory' );
return $post_id;
}
add_action('save_post_attachment', 'bhc_create_package', 10, 1);
thank you that is helpful
Nevermind – I found where this is controlled:
\wp-content\plugins\download-manager\assets\css\admin-styles.css
\wp-content\plugins\download-manager\admin\tpls\metaboxes\attach-file.php
Thank you!! That got me 90% of the way there!
I want do also hide the Download Availability Period and make the URL tab be default in the Attach File meta box.
Doesn’t work. I have an image attached to the package and when I saved it – there was no featured image added.
add_filter(‘save_post’, ‘set_featured_image_from_attachment’);
function set_featured_image_from_attachment($content) {
global $post;
if (has_post_thumbnail()) {
// display the featured image
$content = the_post_thumbnail() . $content;
} else {
// get & set the featured image
$attachments = get_children(array(
‘post_parent’ ► $post->ID,
‘post_status’ ► ‘inherit’,
‘post_type’ ► ‘attachment’,
‘post_mime_type’ ► ‘image’,
‘order’ ► ‘ASC’,
‘orderby’ ► ‘menu_order’
));
if ($attachments) {
foreach ($attachments as $attachment) {
set_post_thumbnail($post->ID, $attachment->ID);
break;
}
// display the featured image
$content = the_post_thumbnail() . $content;
}
}
return $content;
}
Not sure why you guys refuse to help!?
Yes but there is no documentation on how to use it. Please help?
What is the code I would need to enter?
What is the exact PHP code I could enter to create a new package?
I want the Featured image to automatically be set to be the same as the attachment.
What is the exact PHP code I would need to add?
What php echo code would produce a list of package
?
I already fixed it and you already have it..
Unfortunately it doesn’t work and the search is still broken. Any ideas on how to fix it so that it would work in the way a user would expect?
I am really in need of some help here.
I sent an email to customizations days ago but there was no reply.
I’m ready to abort using this plugin…
Thank you. I tried Search Everything and many other similar plugins but they did not “find” any of the packages. I’ll check the other resource you mentioned.
That’s not PHP, that is using the template tags which do not work for me.
Which is handled in which file, please?
Is anyone there?
Ok thank you. So there is no way to fix this?
The shortcode doesn’t seem to work properly.
Where is the add package function referenced?