Skip to content

Instantly share code, notes, and snippets.

View mitchellkrogza's full-sized avatar
🤓
Busy ... Always busy

Mitchell Krog mitchellkrogza

🤓
Busy ... Always busy
View GitHub Profile
@mitchellkrogza
mitchellkrogza / woocommerce-ninja-product-enquiry-form
Created June 7, 2021 10:54
Replace Woocommerce Product Enquiry Form with Ninja Form
// Include a Ninja Forms form in a product page. Different forms for simple and variable products.
add_filter( 'the_content', 'ninja_product_enquiry_form' );
function ninja_product_enquiry_form( $content ) {
if ( class_exists( 'woocommerce' ) && is_product() && is_main_query() ) {
global $product;
if ( 'simple' == $product->get_type() ) {
ob_start();
Ninja_Forms()->display( 3 ); // Equivalent to shortcode: [ninja_form id=3]
return $content . ob_get_clean();
}
@mitchellkrogza
mitchellkrogza / disable-wp-image-scaling
Created June 6, 2021 14:06
Disable Wordpress Image Scaling
add_filter( 'big_image_size_threshold', '__return_false' );
@mitchellkrogza
mitchellkrogza / bypass-woocommerce-logout-confirmation
Last active June 6, 2021 14:05
Bypass Woocommerce Logout Confirmation
function flatsome_bypass_logout_confirmation() {
global $wp;
if ( isset( $wp->query_vars['customer-logout'] ) ) {
wp_redirect( str_replace( '&', '&', wp_logout_url( wc_get_page_permalink( 'myaccount' ) ) ) );
exit;
}
}
add_action( 'template_redirect', 'flatsome_bypass_logout_confirmation' );
@mitchellkrogza
mitchellkrogza / disable-wp-lazy-load
Created June 6, 2021 14:05
Disable Wordpress Lazy Load
add_filter( 'wp_lazy_loading_enabled', '__return_false' );
@mitchellkrogza
mitchellkrogza / disable-wp-sitemaps
Created June 6, 2021 14:04
Disable Wordpress 5 sitemaps
add_filter( 'wp_sitemaps_enabled', '__return_false' );
add_action('wp_head', 'inject_flatsomeshop', 5);
function inject_flatsomeshop() {
ob_start();
include 'wp-content/themes/flatsome/assets/css/flatsome-shop.css';
$atf_css = ob_get_clean();
if ($atf_css != "" ) {
echo '<style id="inline-css" type="text/css">'. $atf_css . '</style>';
}
}
add_action('wp_head', 'inject_flatsomeiefallback', 5);
function inject_flatsomeiefallback() {
ob_start();
include 'wp-content/themes/flatsome/assets/css/ie-fallback.css';
$atf_css = ob_get_clean();
if ($atf_css != "" ) {
echo '<style id="inline-css" type="text/css">'. $atf_css . '</style>';
}
}
@mitchellkrogza
mitchellkrogza / index.html
Last active April 10, 2021 03:31 — forked from anonymous/index.html
Vortex CSS Animation
<canvas id="canvas"></canvas>
@mitchellkrogza
mitchellkrogza / woocommerce-update-prices.sql
Created November 2, 2020 05:48 — forked from yanknudtskov/woocommerce-update-prices.sql
Queries for updating all prices including variations in WooCommerceIn this instance all prices are subtracted 20% (0.8)#woocommerce #mysql
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_regular_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_sale_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_regular_price_tmp' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_sale_price_tmp' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_price_tmp' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_min_variation_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_max_variation_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_min_variation_regular_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHE

Keybase proof

I hereby claim:

  • I am mitchellkrogza on github.
  • I am mitchellkrogza (https://keybase.io/mitchellkrogza) on keybase.
  • I have a public key ASDclc6D97oQyImXQ4qv4aNoymHIyJm0gdjEjor-plBm8go

To claim this, I am signing this object: