Changeset 1115226
- Timestamp:
- 03/18/2015 01:00:03 PM (11 years ago)
- Location:
- wp-farsi
- Files:
-
- 5 added
- 2 edited
-
tags/2.0 (added)
-
tags/2.0/index.php (added)
-
tags/2.0/license.html (added)
-
tags/2.0/pdate.php (added)
-
tags/2.0/wp-farsi.php (added)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/wp-farsi.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-farsi/trunk/readme.txt
r1113363 r1115226 44 44 == Changelog == 45 45 46 = 2.0 = 47 * Support WP 3.0.1 - 4.2 48 46 49 = 1.8.2 = 47 50 * Fixed a bug -
wp-farsi/trunk/wp-farsi.php
r1113363 r1115226 6 6 Author: Ali.Dbg 7 7 Author URI: https://github.com/alidbg/wp-farsi 8 Version: 1.8.28 Version: 2.0 9 9 License: GPLv3 (http://www.gnu.org/licenses/gpl-3.0.html) 10 10 */ … … 46 46 47 47 function wpfa_patch_func($patch = false) { 48 $source = ABSPATH . 'wp-includes/functions.php'; 49 $pattern = "else\n\t\treturn date( " . '$format, $i' . " );"; 50 $replace = "else\n\t\treturn date_i18n( " . '$format, $i' . " );"; 51 if (!$patch) list($replace, $pattern) = array($pattern,$replace); 52 if (is_readable($source) && is_writable($source)) 53 file_put_contents($source, str_replace($pattern, $replace, file_get_contents($source))); 48 $f = ABSPATH . 'wp-includes/functions.php'; 49 if (!is_writable($f)) return; 50 $re = "/(else\\s+return\\s+(date.*[(]))/"; 51 $src = file_get_contents($f); 52 if (preg_match($re, $src, $match) === 1){ 53 if ($match[2] === "date(" && $patch) 54 file_put_contents($f, str_replace($match[1], "else\n\t\treturn date_i18n(", $src)); 55 elseif ($match[2] === "date_i18n(" && !$patch) 56 file_put_contents($f, str_replace($match[1], "else\n\t\treturn date(", $src)); 57 } 54 58 } 55 59 56 60 function timestampdiv() {?> 57 61 <script type='text/javascript'> 58 var c = ("۰,۱,۲,۳,۴,۵,۶,۷,۸,۹,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec").split(",") ,59 d = ("0,1,2,3,4,5,6,7,8,9,فرو,ارد,خرد,تیر,مرد,شهر,مهر,آبا,آذر,دی,بهم,اسف").split(",");62 var c = ("۰,۱,۲,۳,۴,۵,۶,۷,۸,۹,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec").split(","); 63 var d = ("0,1,2,3,4,5,6,7,8,9,فرو,ارد,خرد,تیر,مرد,شهر,مهر,آبا,آذر,دی,بهم,اسف").split(","); 60 64 jQuery(document).ready(function(){ 61 65 jQuery("#timestampdiv,.timestamp-wrap,.inline-edit-date,.jj,.mm,.aa,.hh,.mn,.ss").html(function(a,b){ … … 68 72 69 73 function dreg_jsfa() { 70 wp_de queue_script('ztjalali_reg_admin_js');71 wp_de queue_script('ztjalali_reg_date_js');72 wp_de queue_script('wpp_admin');74 wp_deregister_script('ztjalali_reg_admin_js'); 75 wp_deregister_script('ztjalali_reg_date_js'); 76 wp_deregister_script('wpp_admin'); 73 77 } 74 78
Note: See TracChangeset
for help on using the changeset viewer.