Skip to content

Instantly share code, notes, and snippets.

@DarkAllMan
DarkAllMan / woocommerce-hide-empty-categores.php
Last active September 12, 2017 07:46 — forked from cklosowski/woocommerce-hide-empty-categores.php
In addition to Chris, I added functionality that child categories will only expand if they are in the selected category.
<?php
/**
Plugin Name: WooCommerce - Exclude empty categories from widget
Plugin URI: https://chrisk.io/woocommerce-hide-categories-with-no-visible-products-in-the-product-category-widget/
Description: Excludes categories with no visible products from the WooCommerce category list
Version: 0.2
Author: Chris Klosowski
Editor: Randall Kam
Author URI: https://chrisk.io
*/
@DarkAllMan
DarkAllMan / woocommerce-hide-empty-categories-shop.php
Last active April 21, 2022 09:46
Woocommerce Hide Empty Categories in Shop (compatible with hidden products and Woocommerce Groups)
<?php
/**
Plugin Name: WooCommerce - Hide categories where no products are visible to user
Plugin URI: https://www.randall.nl
Description: Excludes categories with no visible products from the WooCommerce category overview in shop
Version: 1.2
Author: Randall Kam
Author URI: https://www.randall.nl
*/
@DarkAllMan
DarkAllMan / class-ysm-search.php
Created October 5, 2017 06:45
Smart Woocommerce Search with Groups Compatibility
<?php
/**
* Class Ysm_Search
* Retrieves posts from the database depending on settings
*/
class Ysm_Search
{
/**
@DarkAllMan
DarkAllMan / kiyoh.php
Last active October 19, 2020 16:50
Kiyoh, Klantenvertellen create Invite on API
<?php
// HELPER FUNCTION
public function endsWith( $haystack, $needle ) {
return $needle === "" || (substr($haystack, -strlen($needle)) === $needle);
}
public function create_kiyoh_invite($order_id, $this_status_transition_from, $this_status_transition_to, $instance){
$result=false;
$current_domain = 'yourdomain.com';