PluginProbe
Polylang / 2.5.2
Polylang v2.5.2
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 | admin/admin-filters-post.php +8 -11 2.72.5.2 View file →
@@ -46,9 +46,8 @@
46 46
47 47 // Hierarchical taxonomies
48 48 if ( 'edit' == $screen->base && $taxonomies = get_object_taxonomies( $screen->post_type, 'object' ) ) {
49 49 // Get translated hierarchical taxonomies
50 - $hierarchical_taxonomies = array();
51 50 foreach ( $taxonomies as $taxonomy ) {
52 51 if ( $taxonomy->hierarchical && $taxonomy->show_in_quick_edit && $this->model->is_translated_taxonomy( $taxonomy->name ) ) {
53 52 $hierarchical_taxonomies[] = $taxonomy->name;
54 53 }
@@ -54,10 +53,9 @@
54 53 }
55 54 }
56 55
57 56 if ( ! empty( $hierarchical_taxonomies ) ) {
58 - $terms = get_terms( $hierarchical_taxonomies, array( 'get' => 'all' ) );
59 - $term_languages = array();
57 + $terms = get_terms( $hierarchical_taxonomies, array( 'get' => 'all' ) );
60 58
61 59 foreach ( $terms as $term ) {
62 60 if ( $lang = $this->model->term->get_language( $term->term_id ) ) {
63 61 $term_languages[ $lang->slug ][ $term->taxonomy ][] = $term->term_id;
@@ -72,10 +70,9 @@
72 70 }
73 71
74 72 // Hierarchical post types
75 73 if ( 'edit' == $screen->base && is_post_type_hierarchical( $screen->post_type ) ) {
76 - $pages = get_pages();
77 - $page_languages = array();
74 + $pages = get_pages();
78 75
79 76 foreach ( $pages as $page ) {
80 77 if ( $lang = $this->model->post->get_language( $page->ID ) ) {
81 78 $page_languages[ $lang->slug ][] = $page->ID;
@@ -106,9 +103,9 @@
106 103 *
107 104 * @since 2.3
108 105 */
109 106 public function edit_post() {
110 - if ( isset( $_POST['post_lang_choice'], $_POST['post_ID'] ) && $post_id = (int) $_POST['post_ID'] ) { // phpcs:ignore WordPress.Security.NonceVerification
107 + if ( isset( $_POST['post_lang_choice'], $_POST['post_ID'] ) && $post_id = (int) $_POST['post_ID'] ) {
111 108 check_admin_referer( 'pll_language', '_pll_nonce' );
112 109
113 110 $post = get_post( $post_id );
114 111 $post_type_object = get_post_type_object( $post->post_type );
@@ -113,12 +110,12 @@
113 110 $post = get_post( $post_id );
114 111 $post_type_object = get_post_type_object( $post->post_type );
115 112
116 113 if ( current_user_can( $post_type_object->cap->edit_post, $post_id ) ) {
117 - $this->model->post->set_language( $post_id, $this->model->get_language( sanitize_key( $_POST['post_lang_choice'] ) ) );
114 + $this->model->post->set_language( $post_id, $this->model->get_language( $_POST['post_lang_choice'] ) );
118 115
119 116 if ( isset( $_POST['post_tr_lang'] ) ) {
120 - $this->save_translations( $post_id, array_map( 'absint', $_POST['post_tr_lang'] ) );
117 + $this->save_translations( $post_id, $_POST['post_tr_lang'] );
121 118 }
122 119 }
123 120 }
124 121 }
@@ -162,12 +159,12 @@
162 159 *
163 160 * @since 2.3
164 161 */
165 162 public function bulk_edit_posts() {
166 - if ( isset( $_GET['bulk_edit'], $_GET['inline_lang_choice'], $_REQUEST['post'] ) && -1 !== $_GET['inline_lang_choice'] ) { // phpcs:ignore WordPress.Security.NonceVerification
163 + if ( isset( $_GET['bulk_edit'], $_GET['inline_lang_choice'] ) && -1 !== $_GET['inline_lang_choice'] ) {
167 164 check_admin_referer( 'bulk-posts' );
168 165
169 - if ( $lang = $this->model->get_language( sanitize_key( $_GET['inline_lang_choice'] ) ) ) {
166 + if ( $lang = $this->model->get_language( $_GET['inline_lang_choice'] ) ) {
170 167 $post_ids = array_map( 'intval', (array) $_REQUEST['post'] );
171 168 foreach ( $post_ids as $post_id ) {
172 169 $this->inline_save_language( $post_id, $lang );
173 170 }
@@ -184,9 +181,9 @@
184 181 check_admin_referer( 'inlineeditnonce', '_inline_edit' );
185 182
186 183 if ( isset( $_POST['post_ID'], $_POST['inline_lang_choice'] ) ) {
187 184 $post_id = (int) $_POST['post_ID'];
188 - $lang = $this->model->get_language( sanitize_key( $_POST['inline_lang_choice'] ) );
185 + $lang = $this->model->get_language( $_POST['inline_lang_choice'] );
189 186 if ( $post_id && $lang ) {
190 187 $this->inline_save_language( $post_id, $lang );
191 188 }
192 189 }