Skip to content

Instantly share code, notes, and snippets.

@timwhitlock
timwhitlock / loco-loader.php
Last active October 17, 2023 17:28
Standalone version of Loco_hooks_LoadHelper
<?php
/*
Plugin Name: Loco Standalone Loader
Description: Mimics Loco_hooks_LoadHelper without dependency on the main plugin
Author: Tim Whitlock
Version: 1.0
*/
new LocoStandaloneLoadHelper;
@nayemDevs
nayemDevs / functions.php
Last active August 29, 2023 08:29
Override seller setup-wizard via child-theme using Class
<?php
class Dokan_Setup_Wizard_Override extends Dokan_Seller_Setup_Wizard {
/**
* Introduction step.
*/
public function dokan_setup_introduction() {
$dashboard_url = dokan_get_navigation_url();
@nayemDevs
nayemDevs / functions.php
Last active February 15, 2022 14:11
deleting product image when deleting a product in Dokan
<?php
add_action( 'before_delete_post', function( $id ) {
$product = wc_get_product( $id );
if ( ! $product ) {
return;
}
$all_product_ids = [];
$product_thum_id_holder = [];
$gallery_image_id_holder = [];