Skip to content

Instantly share code, notes, and snippets.

View barrykooij's full-sized avatar
:shipit:
I may be slow to respond.

Barry Kooij barrykooij

:shipit:
I may be slow to respond.
View GitHub Profile
<?php
// Get the connected posts
$my_connected_downloads = Post_Connector::API()->get_children( "your-dlm-connection", get_the_id() );
// Check
if ( count( $my_connected_downloads ) > 0 ) {
// Loop
foreach ( $my_connected_downloads as $my_connected_download ) {
function dlm_download_headers_remove_robots( $headers ) {
unset( $headers['X-Robots-Tag'] );
return $headers;
}
add_filter( 'dlm_download_headers', 'dlm_download_headers_remove_robots', 10, 1 );
$plm = new RP4WP_Post_Link_Manager();
wp_send_json( $plm->get_children( $_GET['parent_id'] ) );
function dlm_custom_na_redirect( $url ) {
return "https://www.never5.com/";
}
add_filter( "dlm_access_denied_redirect", "dlm_custom_na_redirect" );
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
?>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<style type="text/css">
function dlm_gf_custom_max_cookies( $t ) {
return 2147483647;
}
add_filter( 'dlm_gf_cookie_expire_time', 'dlm_gf_custom_max_cookies' );
function dlm_gf_custom_30_day_cookies( $t ) {
return time()+60*60*24*30;
}
add_filter( 'dlm_gf_cookie_expire_time', 'dlm_gf_custom_30_day_cookies' );
<?php
/**
* Default output for a download via the [download] shortcode
* Taken from /plugins/dlm-page-addon/content-download-pa.single
*/
global $dlm_download, $dlm_page_addon;
if ( $dlm_download == null ) {
return false;
}
function dlm_custom_referrer( $refs ) {
$refs[] = "https://www.yourchinesedomain.cn";
return $refs;
}
add_filter( 'dlm_hotlink_allowed_referers', 'dlm_custom_referrer' );