Skip to content

Instantly share code, notes, and snippets.

@farhadsakhaei
Last active August 28, 2018 12:10
Show Gist options
  • Save farhadsakhaei/ba44ea12b0a992a9dac3f8c441931fc9 to your computer and use it in GitHub Desktop.
Save farhadsakhaei/ba44ea12b0a992a9dac3f8c441931fc9 to your computer and use it in GitHub Desktop.
در صورتی که از افزونه دبلیو پی پارسی استفاده می کنید و مایل نیستید برای برخی از توابع، شمسی سازی استفاده شود می توانید از چنین کدی استفاده نمایید
<?php
if ( in_array( 'wp-parsidate/wp-parsidate.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
global $wpp_settings;
if(isset($wpp_settings) && $wpp_settings['persian_date'] == 'enable'){
$time_string = sprintf( $time_string,
gregdate(DATE_W3C, eng_number(get_the_date( DATE_W3C ))),
get_the_date()
);
}
}else{
$time_string = sprintf( $time_string,
get_the_date( DATE_W3C ),
get_the_date()
);
}
@farhadsakhaei
Copy link
Author

If you use wordpress wp-parsi plugin and you don't like to convert some of dates to Jalali, You can use this snippets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment