This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter("wpdm_disable_scripts", function ($disabled_scripts) { | |
// $disabled_scripts = ['wpdm-bootstrap-js', 'wpdm-bootstrap-css', 'wpdm-font-awesome', 'wpdm-front']; | |
// by default $disabled_scripts = [], means all scripts are enabled, | |
// if you want to disable 'wpdm-bootstrap-css' push it to $disabled_scripts, like $disabled_scripts[] = 'wpdm-bootstrap-css'; | |
// example to disable scripts on page id 123 | |
if(get_the_ID() === 123) { | |
$disabled_scripts[] = 'wpdm-bootstrap-css'; | |
$disabled_scripts[] = 'wpdm-bootstrap-js'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter("get_terms", function ($terms, $tax, $ta, $tz){ | |
$_terms = []; | |
if($tax[0] === 'wpdmcategory') { | |
foreach ($terms as $term) { | |
if(WPDM()->categories::userHasAccess($term->term_id)) { | |
$_terms[] = $term; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( "wpdmpp_as_you_pay_label", function ( $str, $product_id ) { | |
$str = "Your custom text"; | |
return $str; | |
}, 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- WPDM Link Template: Product Preview --> | |
<div class="link-template-default card mb-2"> | |
<div class="card-body"> | |
<div class="media"> | |
<div class="mr-3 img-48">[product_preview_400x500]</div> | |
<div class="media-body"> | |
<h3 class="package-title">[title]</h3> | |
<div class="text-muted text-small"><i class="fas fa-copy"></i> [file_count] [txt=file(s)] <i class="fas fa-hdd ml-3"></i> [file_size]</div> | |
[description] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//www.wpdownloadmanager.com | |
$all_packages = get_posts(['post_type' => 'wpdmpro', 'posts_per_page' => -1]); | |
foreach($all_packages as $package){ | |
$masterKey = \WPDM\__\Crypt::encrypt( [ 'id' => $package->ID, 'time' => time() ] ); | |
update_post_meta($package->ID, '__wpdm_masterkey', $masterKey); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action("PrivateMessage/Message/Views/OpenMessage/BeforeSenderAbout", function (){ | |
?> | |
<div id="pm-sidebar-extended" style="margin: 10px"> | |
<div class="card" style="margin: 0"> | |
<div class="card-header"> | |
<ul class="nav nav-tabs card-header-tabs"> | |
<li class="nav-item"> | |
<a class="nav-link active" data-toggle="tab" data-target="#sein" href="#sein">Sender Info</a> | |
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
jQuery(function($){ | |
$('body').on('click', '.btn-clps', function(e){ | |
e.preventDefault(); | |
$($(this).attr('href')).toggleClass('show'); | |
}); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
jQuery(function($){ | |
$('.wpdm-download-link').each(function(){ | |
$(this).attr('target','_blank'); | |
}); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wpdb; | |
$files = $wpdb->get_var("select meta_value from {$wpdb->prefix}postmeta where meta_key = '__wpdm_files' and post_id = '{$package['ID']}'"); | |
preg_match_all("/i\:([0-9]+)/", $files, $matches); | |
$find = $matches[0]; | |
$replace = []; | |
foreach($matches[1] as $index) { | |
$replace[] = "s:".strlen($index).':"'.$index.'"'; | |
} | |
$files = str_replace($find, $replace, $files); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter("wp_check_filetype_and_ext", function ($mime_type, $file, $filename, $mimes, $real_mime){ | |
$ext = pathinfo($filename, PATHINFO_EXTENSION); | |
$ext = strtolower($ext); | |
if($ext === 'gpg') | |
return ['ext' => 'gpg', 'type' => 'application/gpg', 'proper_filename' => $filename ]; | |
}, 10, 5); |
NewerOlder