PluginProbe
Polylang / trunk
Polylang vtrunk
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
polylang / src / integrations / no-category-base / no-category-base.php

no-category-base.php in Polylang trunk, at src/integrations/no-category-base/no-category-base.php

37 lines 714 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Polylang
4 */
5
6 /**
7 * Manages the compatibility with No Category Base.
8 * Works for Yoast SEO too.
9 *
10 * @since 2.8
11 */
12 class PLL_No_Category_Base {
13 /**
14 * Setups actions.
15 *
16 * @since 2.8
17 */
18 public function init() {
19 add_filter( 'get_terms_args', array( $this, 'no_category_base_get_terms_args' ), 5 ); // Before adding our cache domain.
20 }
21
22 /**
23 * Make sure No category base plugins get all the categories when flushing rules.
24 *
25 * @since 2.1
26 *
27 * @param array $args WP_Term_Query arguments.
28 * @return array
29 */
30 public function no_category_base_get_terms_args( $args ) {
31 if ( doing_filter( 'category_rewrite_rules' ) ) {
32 $args['lang'] = '';
33 }
34 return $args;
35 }
36 }
37