PluginProbe
Polylang / 2.7.3
Polylang v2.7.3
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-base.php +15 -10 2.72.7.3 View file →
@@ -134,22 +134,23 @@
134 134 }
135 135
136 136 $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
137 137
138 - // For each script:
139 - // 0 => the pages on which to load the script
140 - // 1 => the scripts it needs to work
141 - // 2 => 1 if loaded even if languages have not been defined yet, 0 otherwise
142 - // 3 => 1 if loaded in footer
143 - // FIXME: check if I can load more scripts in footer
138 + /*
139 + * For each script:
140 + * 0 => the pages on which to load the script
141 + * 1 => the scripts it needs to work
142 + * 2 => 1 if loaded even if languages have not been defined yet, 0 otherwise
143 + * 3 => 1 if loaded in footer
144 + */
144 145 $scripts = array(
145 - 'post' => array( array( 'edit', 'upload' ), array( 'jquery', 'wp-ajax-response' ), 0, 1 ),
146 - 'term' => array( array( 'edit-tags', 'term' ), array( 'jquery', 'wp-ajax-response', 'jquery-ui-autocomplete' ), 0, 1 ),
147 - 'user' => array( array( 'profile', 'user-edit' ), array( 'jquery' ), 0, 0 ),
148 - 'widgets' => array( array( 'widgets' ), array( 'jquery' ), 0, 0 ),
146 + 'user' => array( array( 'profile', 'user-edit' ), array( 'jquery' ), 0, 0 ),
147 + 'widgets' => array( array( 'widgets' ), array( 'jquery' ), 0, 0 ),
149 148 );
150 149
151 150 if ( ! empty( $screen->post_type ) && $this->model->is_translated_post_type( $screen->post_type ) ) {
151 + $scripts['post'] = array( array( 'edit', 'upload' ), array( 'jquery', 'wp-ajax-response' ), 0, 1 );
152 +
152 153 // Classic editor.
153 154 if ( ! method_exists( $screen, 'is_block_editor' ) || ! $screen->is_block_editor() ) {
154 155 $scripts['classic-editor'] = array( array( 'post', 'media', 'async-upload' ), array( 'jquery', 'wp-ajax-response', 'post' ), 0, 1 );
155 156 }
@@ -157,8 +158,12 @@
157 158 // Block editor with legacy metabox in WP 5.0+.
158 159 if ( method_exists( $screen, 'is_block_editor' ) && $screen->is_block_editor() && ! pll_use_block_editor_plugin() ) {
159 160 $scripts['block-editor'] = array( array( 'post' ), array( 'jquery', 'wp-ajax-response', 'wp-api-fetch' ), 0, 1 );
160 161 }
162 + }
163 +
164 + if ( ! empty( $screen->taxonomy ) && $this->model->is_translated_taxonomy( $screen->taxonomy ) ) {
165 + $scripts['term'] = array( array( 'edit-tags', 'term' ), array( 'jquery', 'wp-ajax-response', 'jquery-ui-autocomplete' ), 0, 1 );
161 166 }
162 167
163 168 foreach ( $scripts as $script => $v ) {
164 169 if ( in_array( $screen->base, $v[0] ) && ( $v[2] || $this->model->get_languages_list() ) ) {