PluginProbe
Translate and Go multilingual – Automatic AI translation – wpLingua / 1.1.0
Translate and Go multilingual – Automatic AI translation – wpLingua v1.1.0
2.16.7 2.16.6 2.16.5 2.16.4 2.16.3 2.16.2 2.16.1 2.16.0 2.15.2 2.15.1 2.15.0 2.14.3 2.14.2 2.14.1 2.14.0 2.13.1 2.13.0 2.12.3 2.12.2 2.12.1 trunk 1.0.3 1.0.4 1.0.5 1.1.0 All 112 releases
wplingua / inc / assets.php

assets.php in Translate and Go multilingual – Automatic AI translation – wpLingua 1.1.0, at inc/assets.php

89 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // If this file is called directly, abort.
4 if ( ! defined( 'WPINC' ) ) {
5 die;
6 }
7
8
9 /**
10 * Register asset for wpLingua in front (CSS, JS)
11 *
12 * @return void
13 */
14 function wplng_register_assets() {
15
16 if ( is_admin() ) {
17 return;
18 }
19
20 /**
21 * Enqueue jQuery
22 */
23
24 wp_enqueue_script( 'jquery' );
25
26 /**
27 * Enqueue wpLingua JS script
28 */
29
30 wp_enqueue_script(
31 'wplingua-script',
32 plugins_url() . '/wplingua/assets/js/script.js',
33 array( 'jquery' ),
34 WPLNG_API_VERSION
35 );
36
37 /**
38 * Enqueue wpLingua CSS style
39 */
40
41 wp_enqueue_style(
42 'wplingua',
43 plugins_url() . '/wplingua/assets/css/front.css',
44 array(),
45 WPLNG_API_VERSION
46 );
47
48 /**
49 * Load assets for visual editor
50 */
51
52 if ( isset( $_GET['wplingua-editor'] ) ) {
53
54 wp_enqueue_style(
55 'wplingua-editor',
56 plugins_url() . '/wplingua/assets/css/editor.css',
57 array(),
58 WPLNG_API_VERSION
59 );
60
61 } elseif ( isset( $_GET['wplingua-list'] ) ) {
62
63 wp_enqueue_style(
64 'wplingua-list',
65 plugins_url() . '/wplingua/assets/css/list.css',
66 array(),
67 WPLNG_API_VERSION
68 );
69
70 }
71
72 /**
73 * Add inline style for wpLingua custom CSS
74 */
75
76 if ( ! isset( $_GET['wplingua-list'] ) ) {
77
78 $custom_css = get_option( 'wplng_custom_css' );
79
80 if ( ! empty( $custom_css )
81 && is_string( $custom_css )
82 ) {
83 $custom_css = wp_strip_all_tags( $custom_css );
84 wp_add_inline_style( 'wplingua', $custom_css );
85 }
86 }
87
88 }
89