This file contains hidden or 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 | |
/* Rename file */ | |
add_action("wpdm_after_upload_file", function ($file_path) { | |
$dir = dirname($file_path); | |
$file = basename($file_path); | |
$ext = \WPDM\libs\FileSystem::fileExt($file); | |
$new_name = str_replace(".{$ext}", "-".uniqid().".{$ext}", $file); | |
$new_path = $dir.'/'.$new_name; |
This file contains hidden or 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 | |
function your_function() { | |
?> | |
<script> | |
jQuery(document).ready(function(){ | |
function disableselect(e) { | |
return false; | |
}; | |
function reEnable() { | |
return true; |
This file contains hidden or 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_blocked_file_types", function ($file_types){ | |
$index = array_search('svg', $file_types); | |
if($index !== false) unset($file_types[$index]); | |
return $file_types; | |
}); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<form> | |
<label>Due Date</label> | |
<input type="datetime-local" id="test-date"> | |
<button id="btn" onclick='convertdate()'>Convert</button> |
This file contains hidden or 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "VisualEditor0", | |
"Effect": "Allow", | |
"Action": [ | |
"s3:ListAllMyBuckets", | |
"s3:GetBucketLocation" | |
], |
This file contains hidden or 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 | |
function wpdm_send_update_notification($ID, $post, $update){ | |
global $wpdb; | |
if (get_post_type() != 'wpdmpro' || wp_is_post_revision( $ID ) || $post->post_status !== 'publish') return; | |
$users = $wpdb->get_results("select uid from {$wpdb->prefix}ahm_download_stats where pid = '{$ID}' and uid != 0"); | |
$emails = []; | |
foreach ($users as $user){ | |
if((int)$user->uid > 0) | |
$emails[] = get_user_by('ID', $user->uid)->user_email; |
This file contains hidden or 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 | |
function wpdm_remove_search($query) { | |
if ($query->is_search) { | |
$post_type = array('post', 'page'); | |
$query->set('post_type', $post_type); | |
}; | |
return $query; | |
}; | |
add_filter('pre_get_posts', 'wpdm_remove_search'); |
This file contains hidden or 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 | |
function wpdm__number_format($number, $plus = true){ | |
$origin_number = $number; | |
if($number > 1000000){ | |
$number = number_format(($number/1000000), 1); | |
$number = $origin_number > $number && $plus ? $number.'M+':$number.'M'; | |
return $number; | |
} | |
if($number > 1000){ | |
$number = number_format(($number/1000), 1); |
This file contains hidden or 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 | |
if (!class_exists('wpmps_testpay')) { | |
class wpmps_testpay { | |
var $TestMode; | |
var $GatewayUrl = "https://test.pay/purchase"; | |
var $Account; | |
var $ReturnUrl; |
This file contains hidden or 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
define('AUTH_KEY', 'put your unique phrase here'); | |
define('SECURE_AUTH_KEY', 'put your unique phrase here'); | |
define('LOGGED_IN_KEY', 'put your unique phrase here'); | |
define('NONCE_KEY', 'put your unique phrase here'); | |
define('AUTH_SALT', 'put your unique phrase here'); | |
define('SECURE_AUTH_SALT', 'put your unique phrase here'); | |
define('LOGGED_IN_SALT', 'put your unique phrase here'); | |
define('NONCE_SALT', 'put your unique phrase here'); |