| @@ -2,10 +2,8 @@ | ||
| 2 | 2 | namespace Elementor\Modules\Home; |
| 3 | 3 | |
| 4 | 4 | use Elementor\Core\Base\App as BaseApp; |
| 5 | 5 | use Elementor\Includes\EditorAssetsAPI; |
| 6 | -use Elementor\Settings; | |
| 7 | -use Elementor\Plugin; | |
| 8 | 6 | use Elementor\Utils; |
| 9 | 7 | |
| 10 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | 9 | exit; // Exit if accessed directly. |
| @@ -24,13 +22,24 @@ | ||
| 24 | 22 | |
| 25 | 23 | add_filter( 'elementor/document/urls/edit', [ $this, 'add_active_document_to_edit_link' ] ); |
| 26 | 24 | } |
| 27 | 25 | |
| 26 | + public function enqueue_fonts(): void { | |
| 27 | + wp_enqueue_style( | |
| 28 | + 'elementor-home-screen-fonts', | |
| 29 | + 'https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap', | |
| 30 | + [], | |
| 31 | + ELEMENTOR_VERSION | |
| 32 | + ); | |
| 33 | + } | |
| 34 | + | |
| 28 | 35 | public function enqueue_home_screen_scripts(): void { |
| 29 | 36 | if ( ! current_user_can( 'manage_options' ) ) { |
| 30 | 37 | return; |
| 31 | 38 | } |
| 32 | 39 | |
| 40 | + $this->enqueue_fonts(); | |
| 41 | + | |
| 33 | 42 | $min_suffix = Utils::is_script_debug() ? '' : '.min'; |
| 34 | 43 | |
| 35 | 44 | wp_enqueue_script( |
| 36 | 45 | 'e-home-screen', |
| @@ -80,8 +89,10 @@ | ||
| 80 | 89 | $editor_assets_api = new EditorAssetsAPI( $this->get_api_config() ); |
| 81 | 90 | $api = new API( $editor_assets_api ); |
| 82 | 91 | |
| 83 | 92 | $config = $api->get_home_screen_items(); |
| 93 | + | |
| 94 | + $config['wpRestNonce'] = wp_create_nonce( 'wp_rest' ); | |
| 84 | 95 | |
| 85 | 96 | return $config; |
| 86 | 97 | } |
| 87 | 98 | |