| @@ -93,11 +93,9 @@ | ||
| 93 | 93 | * Only for Admin Add/Edit Pages |
| 94 | 94 | */ |
| 95 | 95 | public function enqueue( $hook ) { |
| 96 | 96 | $editor = 'core/edit-post'; |
| 97 | - // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only screen detection. | |
| 98 | - $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : ''; | |
| 99 | - if ( $hook === 'site-editor.php' || ( $hook === 'themes.php' && $page === 'gutenberg-edit-site' ) ) { | |
| 97 | + if ( $hook == 'site-editor.php' || ( $hook == 'themes.php' && isset( $_GET['page'] ) && $_GET['page'] == 'gutenberg-edit-site' ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing | |
| 100 | 98 | $editor = 'core/edit-site'; |
| 101 | 99 | } |
| 102 | 100 | |
| 103 | 101 | $this->assets->register( 'betterdocs-blocks-editor-controls', 'blocks/controls.css' ); |
| @@ -106,16 +104,15 @@ | ||
| 106 | 104 | $this->assets->enqueue( 'betterdocs-blocks-actions', 'blocks/actions.js', [] ); |
| 107 | 105 | $this->assets->localize( |
| 108 | 106 | 'betterdocs-blocks-editor', |
| 109 | 107 | 'betterDocsBlocksHelper', |
| 110 | - array_merge([ | |
| 108 | + [ | |
| 111 | 109 | 'is_pro_active' => betterdocs()->is_pro_active(), |
| 112 | - 'is_woocommerce_active' => class_exists( 'WooCommerce' ), | |
| 113 | 110 | 'resturl' => get_rest_url(), |
| 114 | 111 | 'editorType' => $editor, |
| 115 | 112 | 'betterdocs_glossaries' => Helper::get_glossaries(), |
| 116 | 113 | 'docsIcon' => isset( betterdocs()->settings->get( 'docs_list_icon' )['url'] ) ? betterdocs()->settings->get( 'docs_list_icon' )['url'] : '' |
| 117 | - ], betterdocs()->settings->chatbot_active_localize()) | |
| 114 | + ] | |
| 118 | 115 | ); |
| 119 | 116 | |
| 120 | 117 | if ( $hook == 'post-new.php' || $hook == 'post.php' || $hook == 'site-editor.php' ) { |
| 121 | 118 | $this->assets->enqueue( 'fontpicker-default-theme', 'vendor/css/fonticonpicker.base-theme.react.css' ); |