PluginProbe ʕ •ᴥ•ʔ
پارسی دیت – Parsi Date / 2.1.6
پارسی دیت – Parsi Date v2.1.6
6.1 5.1.6 5.1.7 5.1.8 5.1.8.2 6.0 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.0.0-alpha 2.1 2.1.1 2.1.2 2.1.3 2.1.5 2.1.6 2.1.7 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0.1 2.3.0.2 2.3.1 2.3.2 2.3.3 2.3.4 3.0.1 3.0.2 3.0.3 4.0.0 4.0.1 4.0.2 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5
wp-parsidate / includes / admin / other-fix.php
wp-parsidate / includes / admin Last commit date
lists-fix.php 11 years ago other-fix.php 11 years ago styles-fix.php 10 years ago
other-fix.php
55 lines
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 }
55