Skip to content

Commit a3bed5c

Browse files
committed
Added Polylang pro directory support
1 parent df316f9 commit a3bed5c

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

apsfc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
* Add Polylang support for Customizer
55
*
66
* @link https://richardev.com
7-
* @since 1.3.5
7+
* @since 1.3.6
88
* @package Polylang_Customizer
99
*
1010
* @wordpress-plugin
1111
* Plugin Name: Add Polylang support for Customizer
1212
* Plugin URI: https://wordpress.org/plugins/add-polylang-support-for-customizer
1313
* Description: This plugin adds Polylang support for Customizer.
14-
* Version: 1.3.5
14+
* Version: 1.3.6
1515
* Author: richardev
1616
* Author URI: https://richardev.com
1717
* License: GPL-2.0+
@@ -39,7 +39,7 @@ function apsfc_error_notice__error() {
3939
* Start at version 1.0.2 and use SemVer - https://semver.org
4040
* Rename this for your plugin and update it as you release new versions.
4141
*/
42-
define( 'APSFC_VERSION', '1.3.5' );
42+
define( 'APSFC_VERSION', '1.3.6' );
4343
define( 'APSFC_BASENAME', plugin_basename(__FILE__));
4444

4545
require_once plugin_dir_path( __FILE__ ) . '/includes/class-apsfc.php';

includes/class-apsfc.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,13 @@ public function pc_load_textdomain() {
8181
*/
8282
private function __construct() {
8383
if ( !function_exists( 'pll_current_language' ) ) {
84-
$poly_dir = WP_PLUGIN_DIR . '/polylang';
85-
if(!file_exists($poly_dir)) $poly_dir .= '-pro';
86-
if(!file_exists($poly_dir) . '/include/api.php') $poly_dir = WP_PLUGIN_DIR . 'polylang-pro/vendor/wpsyntex/polylang';
87-
require $poly_dir . '/include/api.php';
84+
$poly_file = WP_PLUGIN_DIR . '/polylang/include/api.php';
85+
if(!file_exists($poly_file)){
86+
$poly_file = WP_PLUGIN_DIR . '/polylang-pro/include/api.php';
87+
if(!file_exists($poly_file)) $poly_file = WP_PLUGIN_DIR . '/polylang-pro/vendor/wpsyntex/polylang/include/api.php';
88+
}
89+
90+
require $poly_file;
8891
if(!isset($GLOBALS['polylang'])) $GLOBALS['polylang'] = null;
8992
}
9093
/**

readme.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ or if you go to Admin panel > Plugins > Add new > Upload Plugin and select the a
9696
* fixed API.php location error for multisites.
9797
= 1.3.3 =
9898
* Changed how API.php is included.
99-
= 1.3.5 =
99+
= 1.3.4 =
100100
* Added Polylang PRO dir check
101101
= 1.3.5 =
102+
* Added Polylang PRO dir check
103+
= 1.3.6 =
102104
* Added Polylang PRO dir check

0 commit comments

Comments
 (0)