PluginProbe
Polylang / 3.8.10
Polylang v3.8.10
3.8.10 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 All 234 releases
← All changes | src/admin/admin-base.php +4 -13 3.8.3 → 3.8.10 View file →
@@ -248,9 +248,8 @@
248 248 * 2 => true if loaded even if languages have not been defined yet, false otherwise
249 249 * 3 => true if loaded in footer
250 250 */
251 251 $scripts = array(
252 - 'user' => array( array( 'profile', 'user-edit' ), array( 'jquery' ), false, false ),
253 252 'widgets' => array( array( 'widgets' ), array( 'jquery' ), false, false ),
254 253 );
255 254
256 255 $block_screens = array( 'widgets', 'site-editor' );
@@ -331,9 +330,9 @@
331 330 * @return void
332 331 */
333 332 private function add_inline_scripts() {
334 333 if ( wp_script_is( 'pll_block-editor', 'enqueued' ) ) {
335 - $default_lang_script = 'const pllDefaultLanguage = "' . $this->options['default_lang'] . '";';
334 + $default_lang_script = sprintf( 'const pllDefaultLanguage = %s;', wp_json_encode( $this->options['default_lang'] ) );
336 335 wp_add_inline_script(
337 336 'pll_block-editor',
338 337 $default_lang_script,
339 338 'before'
@@ -605,9 +604,9 @@
605 604 }
606 605
607 606 /**
608 607 * Tells if the Polylang's admin bar menu should be hidden for the current page.
609 - * Conventionally, it should be hidden on edition pages.
608 + * Conventionally, it should be hidden on edition pages, term edit pages and Site Editor pages.
610 609 *
611 610 * @since 3.8
612 611 *
613 612 * @return bool
@@ -612,19 +611,11 @@
612 611 *
613 612 * @return bool
614 613 */
615 614 public function should_hide_admin_bar_menu(): bool {
616 - global $pagenow, $typenow, $taxnow;
615 + global $pagenow;
617 616
618 - if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ), true ) ) {
619 - return ! empty( $typenow );
620 - }
621 -
622 - if ( 'term.php' === $pagenow ) {
623 - return ! empty( $taxnow );
624 - }
625 -
626 - return false;
617 + return in_array( $pagenow, array( 'post.php', 'post-new.php', 'site-editor.php', 'term.php' ), true );
627 618 }
628 619
629 620 /**
630 621 * Returns the ID of a Polylang's settings screen.