Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
I may be slow to respond.

Barry Kooij barrykooij

:shipit:
I may be slow to respond.
View GitHub Profile
View gist:67578df92db4c8133d4106135ec08114
add_filter( 'dlm_as3_request_valid_minutes', function ( $minutes, $download, $version, $path ) {
return 60;
}, 10, 4 );
View dlm-s3-expire-1-minute.php
add_filter( 'dlm_as3_request_valid_minutes', function ( $minutes, $download, $version, $path ) {
return 1;
}, 10, 4 );
View content-download-pa.php
<?php
/**
* Default output for a download via the [download] shortcode
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
/** @var DLM_Download $dlm_download */
View dlm-pa-cat-order-date-desc.php
add_action( 'dlm_page_addon_get_category_args', function ( $args ) {
$args['orderby'] = 'ID';
$args['order'] = 'DESC';
return $args;
}, 11, 1 );
View rp4wp-get_children.php
<?php
$link_manager = new RP4WP_Post_Link_Manager();
$related_posts = $link_manager->get_children( get_the_ID() );
View dlm-pa-only-top-level-cats.php
add_filter( 'dlm_page_addon_get_category_args', function ( $args ) {
$args['parent'] = 0;
return $args;
} );
View gist:9dcb4c4b26e3bd4f9af243940a7e2bb9
<?php
// Get the connected posts
$child_posts = Post_Connector::API()->get_children( "course", get_the_id() );
$parent_posts = Post_Connector::API()->get_parents( "course", get_the_id() );
$my_connected_posts = array_merge( $child_posts, $parent_posts );
// Check
if ( count( $my_connected_posts ) > 0 ) {
View gist:99841383aaa806b1172f70d7e5fa030e
add_filter( 'pc_display_backwards_linking_same_post_type', function ( $r ) {
return true;
} );
View gist:e164c81ccdc07aaf0350634f174f78a7
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
// use Helper namespace in this class, do not remove
use Never5\WPCarManager\Helper;
?>
<tr>
View gist:fc14573b695d28fedc967c837f923be5
function dlm_dp_change_downloading_page_delay( $seconds ) {
return 10;
}
add_filter( 'dlm_dp_automated_start_seconds', 'dlm_dp_change_downloading_page_delay' );