This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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() ) } ); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Template for displaying all single posts. | |
* | |
* @package dokan | |
* @package dokan - 2014 1.0 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Update post_author id for shop_orders | |
* | |
* @since 2.9.4 | |
* | |
* @return void | |
*/ | |
function dokan_update_variation_product_vendor() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( 'invoice.payment_succeeded' == $event->type ) { | |
$user_id = $wpdb->get_var( "SELECT `user_id` FROM $wpdb->usermeta WHERE `meta_key` = '_stripe_subscription_id' AND `meta_value`='$invoice->subscription'" ); | |
$period_start = date( 'Y-m-d H:i:s', $invoice->period_start ); | |
$period_end = date( 'Y-m-d H:i:s', $invoice->period_end ); | |
$order_id = get_user_meta( $user_id, 'product_order_id', true ); | |
if ( $invoice->paid ) { | |
update_user_meta( $user_id, 'product_pack_startdate', $period_start ); | |
update_user_meta( $user_id, 'product_pack_enddate', $period_end ); | |
update_user_meta( $user_id, 'can_post_product', '1' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/SumonMSelim/.oh-my-zsh | |
# Set name of the theme to load. | |
ZSH_THEME="powerlevel9k/powerlevel9k" | |
POWERLEVEL9K_MODE="awesome-fontconfig" | |
# User configuration | |
export TERM="xterm-256color" | |
export SHELL="/bin/zsh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_product_query', function( $qeury ) { | |
if ( empty( $qeury->query_vars['orderby'] ) || 'popularity' !== $qeury->query_vars['orderby'] ) { | |
return; | |
} | |
add_filter( 'posts_clauses', function( $args ) { | |
$args['orderby'] = ' CASE wc_product_meta_lookup.min_price WHEN 0 THEN 1 | |
ELSE -1 | |
END ASC, wc_product_meta_lookup.total_sales DESC, wc_product_meta_lookup.product_id DESC | |
'; |
NewerOlder