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 | |
/** | |
* Elementor archive posts sort | |
*/ | |
add_action( 'pre_get_posts', function ( $query ) { | |
// Only modify the query we want | |
if ( ! $query->is_main_query() || ! $query->is_archive() ) { | |
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
<?php | |
/** | |
* Author: https://mo.hamed.dev | |
* This file handles uploading and removing custom profile pic with AJAX | |
* Please note, you have to add removing image AJAX request | |
*/ | |
add_action('wp_enqueue_scripts', 'moodev_enqueue_scripts'); | |
function moodev_enqueue_scripts() | |
{ |
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 | |
// https://www.proy.info/woocommerce-allow-only-1-product-per-category/ | |
// Allow only one(or pre-defined) product per category in the cart | |
// Alternatively, try plugin: https://wordpress.org/plugins/woo-cart-limit/ | |
add_filter( 'woocommerce_add_to_cart_validation', 'allowed_quantity_per_category_in_the_cart', 10, 2 ); | |
function allowed_quantity_per_category_in_the_cart( $passed, $product_id) { | |
$max_num_products = 1;// change the maximum allowed in the cart | |
$running_qty = 0; |
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
@echo off | |
SET PhpStormPath=C:\Program Files\JetBrains\PhpStorm 2020.2.1\bin\phpstorm64.exe | |
echo Adding file entries | |
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm" /t REG_SZ /v "" /d "Open in PhpStorm" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f | |
echo Adding within a folder entries |