Created
January 24, 2020 22:01
-
-
Save mahfelwp/365adbc034dbbdf66c8dfc0b81f60b1a to your computer and use it in GitHub Desktop.
Convert activity product date to shamsi(jalali) - youzer plugin
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 | |
function convert_activity_product_date_to_shamsi($args , $product){ | |
if( ! function_exists('parsidate') || get_locale() != 'fa_IR' ) { | |
return false; | |
} | |
$args['date'] = parsidate("Y-m-d", $product->get_date_created()->format( 'F j, Y' ), "per"); | |
return $args; | |
} | |
add_filter( 'yz_wc_activity_product_args' , 'convert_activity_product_date_to_shamsi', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment