This file contains hidden or 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 | |
/** | |
کد زیر رو به فایل | |
functions.php | |
قالبتون اضافه کنید: | |
**/ | |
/** | |
* Add calculator Shortcode | |
*/ |
This file contains hidden or 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 | |
/** | |
* تغییر متن دکمه «افزودن به سبد خرید» برای محصولات دانلودی رایگان | |
*/ | |
// تغییر متن دکمه در فروشگاه، دسته و برچسب محصول و صفحات آرکایو | |
add_filter( 'woocommerce_product_add_to_cart_text', 'ywp_custom_product_add_to_cart_text', 10, 2 ); | |
// تغییر متن دکمه در صفحه محصول | |
add_filter( 'woocommerce_product_single_add_to_cart_text', 'ywp_custom_product_add_to_cart_text', 10, 2 ); | |
function ywp_custom_product_add_to_cart_text( $add_to_cart_text, $product ) { | |
if( $product->is_in_stock() && $product->is_downloadable() && $product->get_price() == 0 ) { // محصول موجود، دانلودی و قیمتش صفر باشه |
This file contains hidden or 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 | |
add_action( 'wp_footer', 'ywp_goftino_auto_pm' ); | |
function ywp_goftino_auto_pm() { | |
echo '<script> | |
if (!localStorage.getItem("goftino_timing") || new Date().getTime() - localStorage.getItem("goftino_timing") >= 60000*24*60){ | |
localStorage.setItem("goftino_timing", new Date().getTime()); | |
localStorage.removeItem("goftino_autopm"); | |
} | |
</script>'; | |
} |
This file contains hidden or 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 | |
/** | |
* اضافه کردن وضعیت موجودی جدید | |
*/ | |
add_filter( 'woocommerce_product_stock_status_options', 'ywp_custom_product_stock_status' ); | |
function ywp_custom_product_stock_status( $status ) { | |
$status['my_first_status'] = 'وضعیت جدید اول'; | |
$status['my_second_status'] = 'وضعیت جدید دوم'; | |
return $status; |
This file contains hidden or 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 | |
/** | |
* GravityForm default user's merge tags doc: https://docs.gravityforms.com/user-merge-tag/ | |
* Sometimes, default merge tags are not enough for us. | |
* With this snippet you can add custom user meta as a | |
* new merge tag to gform. | |
*/ | |
/** |
NewerOlder