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 | |
// plaats deze code in het functions.php bestand van je child thema | |
add_filter( 'woocommerce_variation_is_active', 'fws_disable_variations_out_of_stock', 10, 2 ); | |
function fws_disable_variations_out_of_stock( $is_active, $variation ) { | |
if ( ! $variation->is_in_stock() ) return false; | |
return $is_active; | |
} |
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 ac_column_value_usage( $col_value, $id, AC\Column $column ) { | |
if ('column-wc-product_details' == $column->get_type()) { | |
$order = wc_get_order( $id ); | |
foreach ( $order->get_items() as $item_id => $item ) { | |
if ( $item->get_variation_id() ) { | |
$product = $item->get_product(); | |
foreach ( $product->get_attributes() as $attribute => $value ) { | |
$name = term_exists( $value, $attribute ) ? get_term_by( 'slug', $value, $attribute )->name : $value; | |
$col_value = $col_value .'<br>' . $name; |
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 fws_enqueue_recaptcha() { | |
$sitekey = mysitekey'; | |
wp_enqueue_script( 'fws-recaptcha', '//www.google.com/recaptcha/api.js?render=' . $sitekey, null, null, true ); | |
} | |
add_action( 'wp_enqueue_scripts', 'oceanwp_child_enqueue_parent_style' ); | |
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 | |
set_time_limit(0); | |
ini_set('memory_limit', '2048M'); // if your list is very long | |
$api_key = 'PLACE HERE YOUR API'; | |
$fp = fopen('emailchecked.csv', 'w'); | |
fputcsv($fp, array('Email address', 'Valid MX', 'Valid SMTP', 'Score')); | |
$count = 0; |
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 | |
// disable the generation of large image sizes | |
function fws_disable_image_sizes($sizes) { | |
unset($sizes['medium_large']); | |
unset($sizes['1536x1536']); // 2x medium-large size | |
unset($sizes['2048x2048']); // 2x large size | |
return $sizes; | |
} | |
add_action('intermediate_image_sizes_advanced', 'fws_disable_image_sizes'); |
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 | |
/** | |
* Checkout Form | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
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 | |
// Register Modified Date Column for both posts & pages | |
function modified_column_register( $columns ) { | |
$columns['Modified'] = __( 'Modified Date', 'show_modified_date_in_admin_lists' ); | |
return $columns; | |
} | |
add_filter( 'manage_posts_columns', 'modified_column_register' ); | |
add_filter( 'manage_pages_columns', 'modified_column_register' ); | |
function modified_column_display( $column_name, $post_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_gpf_elements_google', function ( $elements, $product_id, $variation_id ) { | |
$elements['product_type'] = array_map( function ( $item ) { | |
if ( empty( $item->parent ) ) { | |
return $item->name; | |
} | |
$parent_list = array_reverse( get_ancestors( $item->term_id, 'product_cat', 'taxonomy' ) ); | |
$parent_list = array_map( function ( $term_id ) { | |
$term = get_term( $term_id, 'product_cat' ); |
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 my_register_cf7_js() { | |
// Dequeue cf7 and recaptcha scripts, preventing them from loading everywhere | |
add_filter( 'wpcf7_load_js', '__return_false' ); // Might as well use their filter | |
wp_dequeue_script( 'google-recaptcha' ); | |
// If current post has cf7 shortcode, enqueue! | |
global $post; | |
if ( isset( $post->post_content ) AND has_shortcode( $post->post_content, 'contact-form-7' ) ) { |
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( 'storefront_header', 'ctheme_storefront_header_content', 40 ); | |
function ctheme_storefront_header_content() { | |
echo ' | |
<div class="header-usp"> | |
Gratis verzending - Voor 14 uur besteld? Volgende dag bezorgt. | |
</div>'; | |
} |