| Conditions | 2 |
| Paths | 2 |
| Total Lines | 29 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types = 1); |
||
| 19 | protected function enqueue(): void { |
||
| 20 | $handle = "{$this->plugin->get_slug()}-editor"; |
||
| 21 | |||
| 22 | $this->enqueue_script( |
||
| 23 | $handle, |
||
| 24 | $this->plugin->get_url( 'dist/editor.js' ), |
||
| 25 | $this->plugin->get_path( 'dist/editor.js' ), |
||
| 26 | ['jquery', 'wp-i18n'], |
||
| 27 | true, |
||
| 28 | ); |
||
| 29 | |||
| 30 | $this->enqueue_style( |
||
| 31 | $handle, |
||
| 32 | $this->plugin->get_url( 'dist/styles/editor.css' ), |
||
| 33 | $this->plugin->get_path( 'dist/styles/editor.css' ), |
||
| 34 | ); |
||
| 35 | |||
| 36 | if ( ! function_exists( 'wp_set_script_translations' ) ) { |
||
| 37 | return; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * The `.json` file must be on following format: domain-locale-handler.json |
||
| 42 | * You can generate this file with `po2json` |
||
| 43 | */ |
||
| 44 | wp_set_script_translations( |
||
| 45 | $handle, |
||
| 46 | $this->plugin->get_slug(), |
||
| 47 | $this->plugin->get_path( 'languages' ), |
||
| 48 | ); |
||
| 52 |