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
class JDF { | |
/* In the name of Allah = بسم اللّه الرّحمن الرّحیم */ | |
/** | |
* @فارسی : توابع زمان و تاریخ هجری شمسی (جلالی) در پی اچ پی | |
* @name: Hijri_Shamsi,Solar(Jalali) Date and Time Functions | |
* @Author : Reza Gholampanahi & WebSite : http://jdf.scr.ir | |
* @License: GNU/LGPL _ Open Source & Free : [all public functions] | |
* @Version: 2.70 =>[ 1395/11/22 = 1438/05/12 = 2017/02/10 ] |
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_filter( 'woocommerce_add_to_cart_fragments', 'siaeb_change_cart_fragments' ); | |
function siaeb_change_cart_fragments($args) { | |
$args['items'] = [ | |
'count' => WC()->cart->get_cart_contents_count(), | |
]; | |
return $args; | |
} |
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
class MediaLibraryFeatures { | |
private static $instance = null; | |
/** | |
* Get single instance of this class - Singleton | |
* | |
* @since 1.0 | |
*/ | |
public static function getInstance() { |
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
function woo_scripts_cleaner() { | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); | |
if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { | |
$woo_styles = [ | |
'woocommerce_frontend_styles', | |
'woocommerce-general', | |
'woocommerce-layout', | |
'woocommerce-smallscreen', | |
'woocommerce_fancybox_styles', | |
'woocommerce_chosen_styles', |
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('admin_init', 'wpt_force_logout', 15); | |
function wpt_force_logout() { | |
$action = isset($_GET['action']) ? strtolower($_GET['action']) : false; | |
if (!$action || 'wpt-logout' !== $action) { | |
return; | |
} | |
$user_id = isset($_GET['user_id']) ? absint($_GET['user_id']) : false; | |
if (!$user_id || empty(trim($user_id))) { | |
return; |
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
/** | |
* Get All orders IDs for a given product ID. | |
* | |
* @param integer $product_id (required) | |
* @param array $order_status (optional) Default is 'wc-completed' | |
* | |
* @return array | |
*/ | |
public function getOrderIdsByProductId($product_id, $order_status = ['wc-completed', 'wc-processing']) { | |
global $wpdb; |