Skip to content

Instantly share code, notes, and snippets.

View jakubferenc's full-sized avatar

Jakub Albert Ferenc jakubferenc

View GitHub Profile
@jakubferenc
jakubferenc / wordpress-woocommerce-delete-all-products.sql
Last active February 8, 2020 18:34
Wordpress/WooCommerce - Delete all products
-- based on https://gist.github.com/ruscon%20 https://gist.github.com/mikaelz/d574457cb22f1f79f337
DELETE relations.*, taxes.*, terms.*
FROM wp_term_relationships AS relations
INNER JOIN wp_term_taxonomy AS taxes
ON relations.term_taxonomy_id=taxes.term_taxonomy_id
INNER JOIN wp_terms AS terms
ON taxes.term_id=terms.term_id
WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type='product');
DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'product');
@jakubferenc
jakubferenc / README.md
Created March 13, 2017 23:15 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@jakubferenc
jakubferenc / functions.php
Created March 5, 2017 18:22 — forked from fuyuko/functions.php
Cheatsheet - WooCommerce Customization in functions.php
//Add a stylesheet after default style.css
wp_enqueue_style( 'my-css', get_template_directory_uri() . 'my-css.css', array('themename-style'));
//WooCommerce - Sort products by SKU
add_filter('woocommerce_get_catalog_ordering_args', 'custom_woocommerce_catalog_orderby');
function custom_woocommerce_catalog_orderby( $args ) {
$args['meta_key'] = '_sku';
$args['orderby'] = 'meta_value';
$args['order'] = 'asc';
return $args;
@jakubferenc
jakubferenc / gist:3caca798edf1c1b66db730739d86c333
Created October 21, 2016 13:26 — forked from corsonr/gist:7215762
WooCommerce: Hide Checkout Fields For Virtual Products
<?php
add_filter( 'woocommerce_checkout_fields' , 'woo_remove_billing_checkout_fields' );
/**
* Remove unwanted checkout fields
*
* @return $fields array
*/
function woo_remove_billing_checkout_fields( $fields ) {
@jakubferenc
jakubferenc / .gitignore
Created October 7, 2016 19:52 — forked from salcode/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore