1. <?php
  2. /*
  3. Plugin Name:Urdu Date-Time
  4. Description:This Plugin Localize Roman Date/Time Format to Urdu Date/Time Format
  5. version:0.1
  6. Author: Alif Nizami
  7. Author URI: http://auraq.urdutech.com/
  8. */
  9.  
  10. function MakeUrdu($text){
  11. $text=str_replace('January','&#1580;&#1606;&#1608;&#1585;&#1740;',$text);
  12. $text=str_replace('February','&#1601;&#1585;&#1608;&#1585;&#1740;',$text);
  13. $text=str_replace('March','&#1605;&#1575;&#1585;&#1670;',$text);
  14. $text=str_replace('April','&#1575;&#1662;&#1585;&#1740;&#1604;',$text);
  15. $text=str_replace('May','&#1605;&#1574;&#1740;',$text);
  16. $text=str_replace('June','&#1580;&#1608;&#1606;',$text);
  17. $text=str_replace('July','&#1580;&#1608;&#1604;&#1575;&#1574;&#1740;',$text);
  18. $text=str_replace('August','&#1575;&#1711;&#1587;&#1578;',$text);
  19. $text=str_replace('September','&#1587;&#1578;&#1605;&#1576;&#1585;',$text);
  20. $text=str_replace('October','&#1575;&#1705;&#1578;&#1608;&#1576;&#1585;',$text);
  21. $text=str_replace('November','&#1606;&#1608;&#1605;&#1576;&#1585;',$text);
  22. $text=str_replace('December','&#1583;&#1587;&#1605;&#1576;&#1585;',$text);
  23.  
  24. $text=str_replace('th',' ',$text);
  25. $text=str_replace('st',' ',$text);
  26. $text=str_replace('AM','&#1589;&#1576;&#1581;',$text);
  27. $text=str_replace('PM','&#1588;&#1575;&#1605;',$text);
  28. $text=str_replace('am','&#1589;&#1576;&#1581;',$text);
  29. $text=str_replace('pm','&#1588;&#1575;&#1605;',$text);
  30. $text=str_replace('Saturday', '&#1729;&#1601;&#1578;&#1729;',$text);
  31. $text=str_replace('Sunday','&#1575;&#1578;&#1608;&#1575;&#1585;',$text);
  32. $text=str_replace('Monday','&#1587;&#1608;&#1605;&#1608;&#1575;&#1585;',$text);
  33. $text=str_replace('Tuesday','&#1605;&#1606;&#1711;&#1604;',$text);
  34. $text=str_replace('Wednesday','&#1576;&#1583;&#1726;',$text);
  35. $text=str_replace('Thursday','&#1580;&#1605;&#1593;&#1585;&#1575;&#1578;',$text);
  36. $text=str_replace('Friday','&#1580;&#1605;&#1593;&#1729;',$text);
  37. $text=str_replace('0','&#1776;',$text);
  38. $text=str_replace('1','&#1777;',$text);
  39. $text=str_replace('2','&#1778;',$text);
  40. $text=str_replace('3','&#1779;',$text);
  41. $text=str_replace('4','&#1780;',$text);
  42. $text=str_replace('5','&#1781;',$text);
  43. $text=str_replace('6','&#1782;',$text);
  44. $text=str_replace('7','&#1783;',$text);
  45. $text=str_replace('8','&#1784;',$text);
  46. $text=str_replace('9','&#1785;',$text);
  47.  
  48. return $text;
  49. }
  50.  
  51. add_filter('get_comment_date','MakeUrdu');
  52. add_filter('the_date','MakeUrdu');
  53. add_filter('the_weekday_date','MakeUrdu');
  54. add_filter('get_comment_time','MakeUrdu');
  55. add_filter('get_the_time','MakeUrdu');
  56. add_filter('the_weekday','MakeUrdu');
  57. ?>