Parsi Date - Version 2.1.2

Version Description

  • Fix Broken Plugins Update Link (Farsi Locale)
Download this release

Release Info

Developer parselearn
Plugin Icon Parsi Date
Version 2.1.2
Comparing to
See all releases

Code changes from version 2.1.1 to 2.1.2

Files changed (3) hide show
  1. includes/admin/other-fix.php +54 -0
  2. readme.txt +4 -1
  3. wp-parsidate.php +2 -1
includes/admin/other-fix.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Other Fix Function
4
+ *
5
+ * @package WP-Parsidate
6
+ * @subpackage Admin/Other
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) exit; // No direct access allowed
10
+
11
+ if(is_admin()) {
12
+ /**
13
+ * Fix Broken Plugins Update Link
14
+ *
15
+ * @author Parsa Kafi
16
+ * @parms string $buffer admin page
17
+ * @return string
18
+ */
19
+ function wpp_plugins_update_link_fix($buffer)
20
+ {
21
+ if (get_locale() == 'fa_IR')
22
+ {
23
+ if(preg_match_all('(صورت <a.*?>خودکار به‌روز کنید<\/a>)', $buffer, $update_links))
24
+ {
25
+ foreach($update_links[0] as $link)
26
+ {
27
+ preg_match('/<a href="(.+)">/', $link, $href);
28
+ if(! wp_http_validate_url($href[1]))
29
+ {
30
+ preg_match('!https?://\S+!', $link, $url);
31
+ $link_f = ' صورت '.'<a href="'.$url[0].'"> خودکار به‌روز کنید</a>';
32
+ $buffer = str_replace($link, $link_f, $buffer);
33
+ }
34
+ }
35
+ }
36
+ }
37
+
38
+ return $buffer;
39
+ }
40
+
41
+ add_action('init', 'wpp_admin_buffer_start');
42
+ add_action('admin_footer', 'wpp_admin_buffer_end');
43
+ function wpp_admin_buffer_start()
44
+ {
45
+ global $pagenow;
46
+ if($pagenow == 'plugins.php')
47
+ ob_start("wpp_plugins_update_link_fix");
48
+ }
49
+
50
+ function wpp_admin_buffer_end()
51
+ {
52
+ ob_end_flush();
53
+ }
54
+ }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://forum.wp-parsi.com/
4
  Tags: shamsi, wp-parsi, wpparsi, persian, parsi, farsi, jalali, date, calendar, i18n, l10n, Iran, Iranian, parsidate, rtl
5
  Requires at least: 3.6
6
  Tested up to: 4.1
7
- Stable tag: 2.1.1
8
 
9
  Persian package builder for WordPress, Full RTL and Shamsi(Jalali) date
10
 
@@ -40,6 +40,9 @@ List of some features:
40
  4. Display widget 'Jalali Date Calender' in theme
41
 
42
  == Changelog ==
 
 
 
43
  = 2.1.1 =
44
  * Fix Post permalink with custom structure (%category%/%postname%/)
45
 
4
  Tags: shamsi, wp-parsi, wpparsi, persian, parsi, farsi, jalali, date, calendar, i18n, l10n, Iran, Iranian, parsidate, rtl
5
  Requires at least: 3.6
6
  Tested up to: 4.1
7
+ Stable tag: 2.1.2
8
 
9
  Persian package builder for WordPress, Full RTL and Shamsi(Jalali) date
10
 
40
  4. Display widget 'Jalali Date Calender' in theme
41
 
42
  == Changelog ==
43
+ = 2.1.2 =
44
+ * Fix Broken Plugins Update Link (Farsi Locale)
45
+
46
  = 2.1.1 =
47
  * Fix Post permalink with custom structure (%category%/%postname%/)
48
 
wp-parsidate.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Plugin Name: WP-Parsidate
4
- * Version: 2.1.1
5
  * Plugin URI: http://forum.wp-parsi.com/
6
  * Description: Persian package for WordPress, Adds full RTL and Shamsi (Jalali) support for: posts, comments, pages, archives, search, categories, permalinks and all admin sections and TinyMce editor, lists, quick editor. This package has Jalali archive widget.
7
  * Author: WP-Parsi Team
@@ -110,6 +110,7 @@ final class WP_Parsidate {
110
  'fixes-misc',
111
  'admin/styles-fix',
112
  'admin/lists-fix',
 
113
  'fixes-get_calendar',
114
  'fixes-get_archives',
115
  'plugins/woocommerce',
1
  <?php
2
  /**
3
  * Plugin Name: WP-Parsidate
4
+ * Version: 2.1.2
5
  * Plugin URI: http://forum.wp-parsi.com/
6
  * Description: Persian package for WordPress, Adds full RTL and Shamsi (Jalali) support for: posts, comments, pages, archives, search, categories, permalinks and all admin sections and TinyMce editor, lists, quick editor. This package has Jalali archive widget.
7
  * Author: WP-Parsi Team
110
  'fixes-misc',
111
  'admin/styles-fix',
112
  'admin/lists-fix',
113
+ 'admin/other-fix',
114
  'fixes-get_calendar',
115
  'fixes-get_archives',
116
  'plugins/woocommerce',