| @@ -91,16 +91,14 @@ | ||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | // Share term slugs |
| 94 | 94 | if ( $this->options['force_lang'] && class_exists( 'PLL_Share_Term_Slug' ) ) { |
| 95 | - $this->share_term_slug = new PLL_Share_Term_Slug( $this ); | |
| 95 | + $this->share_term_slug = version_compare( $GLOBALS['wp_version'], '4.8', '<' ) ? | |
| 96 | + new PLL_Frontend_Share_Term_Slug( $this ) : | |
| 97 | + new PLL_Share_Term_Slug( $this ); | |
| 96 | 98 | } |
| 97 | 99 | } |
| 98 | 100 | |
| 99 | - if ( class_exists( 'PLL_Sync_Post_Model' ) ) { | |
| 100 | - $this->sync_post_model = new PLL_Sync_Post_Model( $this ); | |
| 101 | - } | |
| 102 | - | |
| 103 | 101 | if ( class_exists( 'PLL_Sync_Post' ) ) { |
| 104 | 102 | $this->sync_post = new PLL_Sync_Post( $this ); |
| 105 | 103 | } |
| 106 | 104 | } |
| @@ -165,9 +163,9 @@ | ||
| 165 | 163 | $taxonomies = array_diff( $taxonomies, array( 'language', 'category', 'post_tag' ) ); |
| 166 | 164 | |
| 167 | 165 | // Remove pages query when the language is set unless we do a search |
| 168 | 166 | // Take care not to break the single page, attachment and taxonomies queries! |
| 169 | - if ( empty( $qv['post_type'] ) && ! $query->is_search && ! $query->is_singular && empty( $taxonomies ) && ! $query->is_category && ! $query->is_tag ) { | |
| 167 | + if ( empty( $qv['post_type'] ) && ! $query->is_search && ! $query->is_singular && empty( $taxonomies ) ) { | |
| 170 | 168 | $query->set( 'post_type', 'post' ); |
| 171 | 169 | } |
| 172 | 170 | |
| 173 | 171 | // Unset the is_archive flag for language pages to prevent loading the archive template |