PluginProbe
Polylang / 2.5
Polylang v2.5
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
← All changes | include/crud-terms.php +1 -4 2.92.5 View file →
@@ -1,8 +1,5 @@
1 1 <?php
2 -/**
3 - * @package Polylang
4 - */
5 2
6 3 /**
7 4 * Adds actions and filters related to languages when creating, reading, updating or deleting posts
8 5 * Acts both on frontend and backend
@@ -51,9 +48,9 @@
51 48 * @param string $taxonomy
52 49 */
53 50 protected function set_default_language( $term_id, $taxonomy ) {
54 51 if ( ! $this->model->term->get_language( $term_id ) ) {
55 - if ( ! isset( $this->pref_lang ) && ! empty( $_REQUEST['lang'] ) && $lang = $this->model->get_language( sanitize_key( $_REQUEST['lang'] ) ) ) { // phpcs:ignore WordPress.Security.NonceVerification
52 + if ( ! isset( $this->pref_lang ) && ! empty( $_REQUEST['lang'] ) && $lang = $this->model->get_language( $_REQUEST['lang'] ) ) {
56 53 // Testing $this->pref_lang makes this test pass only on frontend.
57 54 $this->model->term->set_language( $term_id, $lang );
58 55 } elseif ( ( $term = get_term( $term_id, $taxonomy ) ) && ! empty( $term->parent ) && $parent_lang = $this->model->term->get_language( $term->parent ) ) {
59 56 // Sets language from term parent if exists thanks to Scott Kingsley Clark