Skip to content

Instantly share code, notes, and snippets.

View ArnoutPullen's full-sized avatar
🎯
Focusing

ArnoutPullen ArnoutPullen

🎯
Focusing
View GitHub Profile
@ArnoutPullen
ArnoutPullen / elasticpress-toolset-integration.php
Created October 23, 2019 16:05
Integrate Toolset Views with ElasticPress
<?php
/**
* Integrate Toolset Views with ElasticPress
* https://github.com/10up/ElasticPress#supported-wp_query-parameters
* https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
*/
function ep_toolset_integration( $query, $view_settings, $view_id ) {
$query['ep_integrate'] = true;
@ArnoutPullen
ArnoutPullen / woo-product-attributes-bulk-modifier.php
Created June 18, 2020 14:34 — forked from birgire/woo-product-attributes-bulk-modifier.php
WordPress: Woocommerce Product Attributes - Bulk Modifier ( from custom to taxonomy attributes)
<?php
/**
* Plugin Name: Product Attributes - Bulk Modifier
* Description: Bulk update 'custom product attributes' to 'taxonomy product attributes'. Supports the GET variables, like: wpq_mode=run&wpq_from=colour&wpq_to=pa_colour&wpq_ppp=10&wpq_offset=0&wpq_post_type=product&wpq_post_status=any. WARNING: Backup DB first!!!
* Plugin Author: birgire
* Plugin URI: https://gist.github.com/birgire/0ed300ae4436fcaf508c
* Version: 0.0.2
*/
/**
@ArnoutPullen
ArnoutPullen / woocommerce-procedures.sql
Last active July 9, 2020 11:23
WooCommerce SQL Procedures
-- https://www.w3schools.com/sql/sql_stored_procedures.asp
-- https://codex.wordpress.org/Database_Description
-- https://github.com/woocommerce/woocommerce/wiki/Database-Description
CREATE PROCEDURE DeleteProduct @ProductID bigint(20)
AS
DELETE FROM wp_posts WHERE ID = @ProductID;
DELETE FROM wp_postmeta WHERE post_id = @ProductID;
DELETE c, cm
@ArnoutPullen
ArnoutPullen / functions.php
Last active November 3, 2020 15:20
Integrate your Toolset views slider with hammer.js
<?php
/**
* Register child theme assets
* Put this in your my-child-theme/functions.php
*/
function my_child_theme_scripts()
{
wp_enqueue_script('hammer', get_stylesheet_directory_uri() . '/assets/js/hammer.min.js', array(), '2.0.8', true);
// wp_enqueue_script('hammer-min', 'https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js', array(), '2.0.8');