Skip to content

Instantly share code, notes, and snippets.

View YFilus's full-sized avatar

Yuri Filus YFilus

View GitHub Profile
@YFilus
YFilus / elementor-auto-height.js
Created January 19, 2024 13:11
Elementor Testimonal Auto Height
<script>
jQuery(document).ready(function($) {
const observer = new MutationObserver(() => { jQuery('.elementor-testimonial').each(function() { jQuery(this).parent().css({height:parseFloat(jQuery(this).height()) + Number(60)});
if(jQuery(this).parent().hasClass('swiper-slide-active')){
jQuery(this).parent().parent().parent().css({height:parseFloat(jQuery(this).height()) + Number(60)})
} });
});
observer.observe(document.body, { attributes: true, attributeFilter: ['class'], subtree: true, }); });
</script>
@YFilus
YFilus / cache-oembed.php
Last active February 8, 2021 18:01
WordPress - Cache wp_oembed_get
<?php
// from https://snippets.khromov.se/how-to-cache-the-wp_oembed_get-function/
define('CUSTOM_OEMBED_CACHE_KEY', 'coc_');
function _wp_custom_oembed_cache_key($url, $args) {
$args_serialized = serialize($args);
return CUSTOM_OEMBED_CACHE_KEY . md5("{$url}-{$args_serialized}");
}
@YFilus
YFilus / remove-gutemberg.php
Last active January 13, 2021 17:49
WordPress - Remove Gutemberg from certain post types
<?php
add_filter('use_block_editor_for_post_type', 'remove_gutemberg', 10, 2);
function remove_gutemberg($can_edit, $post_type){
if($post_type == 'page'){
return false;
}