PluginProbe
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript / 4.1.18
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript v4.1.18
4.1.19 4.1.18 4.1.17 4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.0.30 4.0.29 4.0.28 4.0.27 4.0.26 4.0.24 4.0.25 4.0.23 4.0.22 4.0.21 4.0.19 4.0.18 4.0.17 4.0.16 1.9.3 All 173 releases
← All changes | inc/thirdparty/plugin/Polylang.php +10 -1 4.0.264.1.18 View file →
@@ -7,10 +7,19 @@
7 7 {
8 8 function __construct()
9 9 {
10 10 add_filter('berqwp_page_translation_urls', [$this, 'get_page_translations'], 10, 2);
11 + add_filter('berqwp_site_url', [$this, 'set_home_url'], 10);
11 12 }
12 13
14 + function set_home_url($home_url) {
15 + if (function_exists('pll_home_url')) {
16 + return pll_home_url();
17 + }
18 + return $home_url;
19 + }
20 +
21 +
13 22 function get_page_translations($translated_urls, $post_url)
14 23 {
15 24 // 1. Skip if Polylang isn’t active.
16 25 if (!function_exists('pll_get_post')) {
@@ -38,5 +47,5 @@
38 47
39 48
40 49 }
41 50
42 -new berqPolylang();
51 +new berqPolylang();