dlm_can_download does not work anymore
-
Hi,
I do not know exactly after which update my dlm_can_download filter stops working, but currently the return bool of my filter does not get recognized anymore.
add_filter('dlm_can_download', 'mr_dlm_can_download', 10, 3);
function mr_dlm_can_download ($can_download, $download, $version)
{
$members_only = ( $value = get_post_meta( $download->post->ID, '_members_only', true ) ) ? $value : 'no';
if($members_only=='no')
return true;
if($members_only!='no' && (isset($_COOKIE['bkdlreg']) && $_COOKIE['bkdlreg']=='ok') ) {
return true;
}
return false;
}I’ve double checked the return value from my filter and even if it’s true, the access is’nt granted anymore.
I temporarily helped me out with the following:
// File: class-dlm-members-access-manager.php
// Line: 90
if($download->is_members_only() && (isset($_COOKIE['bkdlreg']) && $_COOKIE['bkdlreg']=='ok') ) {
$can_download = true;
}
if ( $can_download && ! empty( $_SESSION['dlm_error_texts']['members_only'] ) ) {
unset( $_SESSION['dlm_error_texts']['members_only'] );
}
return $can_download;
}
}
- You must be logged in to reply to this topic.