Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit a86b2f8

Browse files
committed
fix load main static page
1 parent 5c7126f commit a86b2f8

File tree

3 files changed

+12
-21
lines changed

3 files changed

+12
-21
lines changed

core/class-wpm-setup.php

+4-12
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Class WPM_Setup
1313
* @package WPM\Core
1414
* @author VaLeXaR
15-
* @version 1.2.1
15+
* @version 1.2.2
1616
*/
1717
class WPM_Setup {
1818

@@ -93,22 +93,14 @@ public function __construct() {
9393
add_filter( 'query_vars', array( $this, 'set_lang_var' ) );
9494
add_filter( 'option_home', array( $this, 'set_home_url' ), 99 );
9595
add_action( 'change_locale', array( $this, 'change_locale' ), 0 );
96-
add_action( 'after_setup_theme', array( $this, 'setup_lang_query' ), 0 );
96+
add_action( 'wp', array( $this, 'setup_lang_query' ), 0 );
9797
add_action( 'after_switch_theme', __NAMESPACE__ . '\WPM_Config::load_config_run' );
9898
add_action( 'activated_plugin', __NAMESPACE__ . '\WPM_Config::load_config_run' );
9999
add_action( 'upgrader_process_complete', __NAMESPACE__ . '\WPM_Config::load_config_run' );
100100
add_action( 'wpm_init', array( $this, 'load_vendor' ) );
101101
add_action( 'template_redirect', array( $this, 'set_not_found' ) );
102102
add_action( 'init', array( $this, 'switch_to_language' ) );
103-
$this->init();
104-
}
105-
106-
107-
/**
108-
* Set locale, load vendor classes
109-
*/
110-
public function init() {
111-
$this->set_locale();
103+
add_action( 'setup_theme', array( $this, 'set_locale' ), 0 );
112104
}
113105

114106

@@ -373,7 +365,7 @@ public function change_locale( $new_locale ) {
373365
*/
374366
public function set_home_url( $value ) {
375367

376-
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
368+
if ( ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) {
377369
return $value;
378370
}
379371

readme.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Contributors: valexar
44
Tags: localization, multilanguage, multilingual, translation, multilang
55
Requires at least: 4.7
66
Tested up to: 4.8
7-
Stable tag: 1.3.5
7+
Stable tag: 1.3.6
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -133,6 +133,9 @@ Compatible with multisite not tested.
133133

134134
== Changelog ==
135135

136+
= 1.3.6 =
137+
* fix load main static page
138+
136139
= 1.3.5 =
137140
* hide wp language settings
138141
* fix load theme localization files

wp-multilang.php

+4-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
99
* Text Domain: wpm
1010
* Domain Path: /languages
11-
* Version: 1.3.5
11+
* Version: 1.3.6
1212
*
1313
* @package WPM
1414
* @category Core
@@ -42,7 +42,7 @@ final class WP_Multilang {
4242
*
4343
* @var string
4444
*/
45-
public $version = '1.3.5';
45+
public $version = '1.3.6';
4646

4747
/**
4848
* The single instance of the class.
@@ -99,7 +99,6 @@ public function __construct() {
9999
private function init_hooks() {
100100
register_activation_hook( __FILE__, array( 'WPM\Core\WPM_Install', 'install' ) );
101101
add_action( 'init', array( $this, 'init' ), 0 );
102-
add_action( 'setup_theme', array( $this, 'setup' ), 0 );
103102
}
104103

105104
/**
@@ -153,17 +152,14 @@ public function includes() {
153152
include_once( 'core/wpm-widget-functions.php' );
154153
include_once( 'core/abstracts/abstract-wpm-object.php' );
155154

155+
Core\WPM_Setup::instance();
156+
156157
if ( $this->is_request( 'frontend' ) ) {
157158
include_once( 'core/wpm-template-hooks.php' );
158159
Core\WPM_Frontend_Scripts::init(); // Frontend Scripts
159160
}
160161
}
161162

162-
163-
public function setup() {
164-
Core\WPM_Setup::instance();
165-
}
166-
167163
/**
168164
* Init Multilang when WordPress Initialises.
169165
*/

0 commit comments

Comments
 (0)