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
function dp_ocp_custom_loader() { | |
ob_start(); | |
?> | |
<div class="dp-ocp-loader"><div class="my_custom_loader"></div></div> | |
<style> | |
.dp-ocp-loader { | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
margin-top: -30px; |
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
function dp_test_tec( $atts ) { | |
$args = shortcode_atts( array( | |
'post_type' => array( 'tribe_events' ), | |
'orderby' => 'date', | |
'order' => 'DESC', | |
), $atts ); | |
$output = ''; | |
$query = new WP_Query( $args ); | |
if ( $query->have_posts() ) { |
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
add_filter( 'wpseo_canonical', 'dfg_get_canonical_url', 10, 2 ); | |
function dfg_get_canonical_url( $canonical_url ) { | |
if ( is_page( 31602 ) ) { | |
$page = 0; | |
if ( get_query_var( 'paged' ) ) { | |
$page = get_query_var( 'paged' ); | |
} elseif ( get_query_var( 'page' ) ) { | |
$page = get_query_var( 'page' ); | |
} |
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
add_filter( 'get_canonical_url', 'dfg_get_canonical_url', 10, 2 ); | |
function dfg_get_canonical_url( $canonical_url, $post ) { | |
if ( has_shortcode( $post->post_content, 'dpdfg_filtergrid' ) ) { | |
$page = 0; | |
if ( get_query_var( 'paged' ) ) { | |
$page = get_query_var( 'paged' ); | |
} elseif ( get_query_var( 'page' ) ) { | |
$page = get_query_var( 'page' ); | |
} |
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
add_filter( 'get_canonical_url', 'dfg_get_canonical_url', 10, 2 ); | |
function dfg_get_canonical_url( $canonical_url, $post ) { | |
if ( $post->ID === 12 ) { | |
$page = 0; | |
if ( get_query_var( 'paged' ) ) { | |
$page = get_query_var( 'paged' ); | |
} elseif ( get_query_var( 'page' ) ) { | |
$page = get_query_var( 'page' ); | |
} |
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
function dpdfg_custom_filters( $filters, $props ) { | |
if ( $props['conditional_tags']['is_archive'] === 'on' && $props['custom_query'] === 'archive' ) { | |
$term_id = $props['the_ID']; | |
$term = get_term( $term_id ); | |
$tax = $term->taxonomy; | |
$child_terms_hierarchy = Dp_Dfg_Utils::get_taxonomy_hierarchy( $tax, $term_id ); | |
$custom_filters = dpdfg_build_custom_filters_hierarchy( $tax, array( | |
'0%%' . $tax => array( | |
array( | |
'id' => 'all', |
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
add_filter( 'dpdfg_allowed_taxonomies', 'dpdfg_allowed_taxonomies' ); | |
function dpdfg_allowed_taxonomies( $taxonomies ) { | |
$product_visibility = get_taxonomy( 'product_visibility' ); | |
if ( $product_visibility ) { | |
$taxonomies[ $product_visibility->name ] = $product_visibility->label; | |
} | |
return $taxonomies; | |
} |
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(document).ready(function($){ | |
$('.dp-dfg-filter a').each(function() { | |
var filterCat = $(this).attr('data-term-id'); | |
var URL = '?dfg_active_filter='+filterCat; | |
$(this).prop('href', URL); | |
$(this).on('click', function() { | |
window.history.replaceState(null, null, URL); | |
}) |
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
add_filter( 'dpddg_custom_images_ids', 'dpddg_custom_images_ids', 10, 2 ); | |
function dpddg_custom_images_ids( $gallery_ids, $props ) { | |
if ( $props['module_id'] === 'photo-gallery' ) { | |
$gallery_ids = explode( ',', get_post_meta( $props['the_ID'], $props['dynamic_content_field'], true ) ); | |
} | |
return $gallery_ids; | |
} |
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
add_filter( 'dpdfg_first_video_data', 'dpdfg_first_video_data', 10, 3 ); | |
function dpdfg_first_video_data( $video_data, $post_id, $props ) { | |
if ( function_exists( 'get_field' ) ) { | |
$video_url = get_field( 'my_acf_file_field', $post_id ); | |
if ( $video_url ) { | |
$video_data['video_url'] = $video_url; | |
$video_data['video_output'] = do_shortcode( '[video src="' . $video_url . '"]' ); | |
} | |
} |