| @@ -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. |