Conditions | 2 |
Paths | 2 |
Total Lines | 29 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | protected function enqueue() { |
||
37 | $handle = "{$this->plugin->get_slug()}-theme"; |
||
38 | |||
39 | $this->enqueue_script( |
||
40 | $handle, |
||
41 | $this->plugin->get_url( 'dist/theme.js' ), |
||
42 | $this->plugin->get_path( 'dist/theme.js' ), |
||
43 | [ 'jquery', 'wp-i18n' ], |
||
44 | true |
||
45 | ); |
||
46 | |||
47 | $this->enqueue_style( |
||
48 | $handle, |
||
49 | $this->plugin->get_url( 'dist/styles/theme.css' ), |
||
50 | $this->plugin->get_path( 'dist/styles/theme.css' ) |
||
51 | ); |
||
52 | |||
53 | if ( ! function_exists( 'wp_set_script_translations' ) ) { |
||
54 | return; |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * The `.json` file must be on following format: domain-locale-handler.json |
||
59 | * You can generate this file with `po2json` |
||
60 | */ |
||
61 | wp_set_script_translations( |
||
62 | $handle, |
||
63 | $this->plugin->get_slug(), |
||
64 | $this->plugin->get_path( 'languages' ) |
||
65 | ); |
||
68 |