Skip to content

Instantly share code, notes, and snippets.

View saimonh3's full-sized avatar
🏠
Working from home

Mohammed Saimon saimonh3

🏠
Working from home
View GitHub Profile
@saimonh3
saimonh3 / class_dokan_update_2_9_21_variation_product_vendor.php
Created October 16, 2019 04:18
dokan_update_2_9_21_variation_product_vendor.hp
<?php
defined( 'ABSPATH' ) || exit;
/**
* Dokan 2.9.4 updater class
*
* @since 2.9.4
*/
class Dokan_Update_2_9_21_Variation_Product_Vendor extends Abstract_Dokan_Background_Processes {
@saimonh3
saimonh3 / class_dokan_update_2_9_21_variation_product_vendor.php
Created October 16, 2019 04:18
class_dokan_update_2_9_21_variation_product_vendor.hp
<?php
defined( 'ABSPATH' ) || exit;
/**
* Dokan 2.9.4 updater class
*
* @since 2.9.4
*/
class Dokan_Update_2_9_21_Variation_Product_Vendor extends Abstract_Dokan_Background_Processes {
@saimonh3
saimonh3 / dokan_get_product_attributes_by_order.php
Created November 18, 2019 07:24
Dokan export order attributes
<?php
/**
* Dokan get seller amount from order total
*
* @param int $order_id
*
* @return float
*/
function dokan_get_seller_amount_from_order( $order_id, $get_array = false ) {
@saimonh3
saimonh3 / store.php
Created May 20, 2020 07:01
store.php
<?php
/**
* The Template for displaying all single posts.
*
* @package dokan
* @package dokan - 2014 1.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@saimonh3
saimonh3 / refresh-media-library.js
Created July 30, 2021 20:09
Refresh the WP media library on image upload.
/**
* Refresh the media library on image upload.
* So, it doesn't show previously uploaded images on new uploads
*/
export const refreshMediaLibrary = () => {
wp?.media?.frame?.content?.get?.()?.collection?.props?.set?.( { ignore: ( +new Date() ) } );
};