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
function dlm_ninja_forms_redirect_to_download() {
if ( isset( $_POST['_download_id'] ) ) {
global $ninja_forms_processing;
$ninja_forms_processing->update_form_setting( 'landing_page', site_url( '/download/' . $_POST['_download_id'] . '/' ) );
}
}
add_action( 'ninja_forms_post_process', 'dlm_ninja_forms_redirect_to_download', 1, 2 );
function pc_only_parent_posts( $args ) {
$args['post_parent'] = 0;
return $args;
}
add_filter( 'pc_manual_link_post_query_args', 'pc_only_parent_posts' );
<script>
var dlm_has_access = 1;
<?php if ( ! apply_filters( 'dlm_can_download', true, $download, $version ) ) : ?>
dlm_has_access = 0;
<?php endif ?>
_gscq = window._gscq || [];
_gscq.push(['targeting','dlm_has_access', dlm_has_access]);
</script>
<?php
global $wp_query, $dlm_download, $dlm_page_addon;
echo apply_filters( 'dlm_widget_downloads_list_start', '<ul class="dlm-downloads">' );
if ( count( $downloads ) ) {
foreach ( $downloads as $download ) {
$dlm_download = new DLM_Download( $download->ID );
echo apply_filters( 'dlm_widget_downloads_list_item_start', '<li>' );
function dlm_only_top_categories( $args ) {
$args[ 'parent' ] = 0;
return $args;
}
add_filter( 'dlm_page_addon_get_category_args', 'dlm_only_top_categories' );
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
?>
<a class="download-link" title="<?php if ( $dlm_download->has_version_number() ) {
printf( __( 'Version %s', 'download-monitor' ), $dlm_download->get_the_version_number() );
} ?>" href="<?php $dlm_download->the_download_link(); ?>" rel="nofollow">
<?php $dlm_download->the_title(); ?>
// Gravity Forms Dynamic Redirect
add_filter( 'gform_confirmation', 'dlm_gf_dynamic_redirect', 10, 4 );
function dlm_gf_dynamic_redirect( $confirmation, $form, $entry, $ajax ) {
$my_label = 'What Download?'; // set this to the exact label of your download select field
// fetch download ID from select
$selected_download = 0;
if ( isset( $form['fields'] ) && is_array( $form['fields'] ) && count( $form ) > 0 ) {
foreach ( $form['fields'] as $field ) {
.wpcm-contact a {
color: #fff;
font-weight: bold;
box-sizing: border-box;
}
add_filter( 'wpcm_currencies', function( $currencies ) {
$currencies[ 'LKR' ] = 'Sri Lankan Rupee';
return $currencies;
}, 10, 1 );
@media (max-width: 750px) {
.rp4wp-related-posts .rp4wp-posts-list .rp4wp-col .rp4wp_component_wrapper {
padding: 0;
margin: 0;
}
.rp4wp-related-posts .rp4wp-posts-list .rp4wp-col .rp4wp_component_wrapper_left {
width: 35%;
}