PluginProbe ʕ •ᴥ•ʔ
External Links – nofollow, noopener & new window / 2.50
External Links – nofollow, noopener & new window v2.50
2.66 0.31 0.32 0.33 0.34 0.35 1.01 1.02 1.03 1.10 1.20 1.21 1.30 1.31 1.40 1.41 1.50 1.51 1.52 1.53 1.54 1.55 1.56 1.60 1.61 1.62 1.70 1.80 1.81 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.1.0 2.1.1 2.1.2 2.1.3 2.2.0 2.3 2.32 2.35 2.40 2.42 2.43 2.45 2.46 2.47 2.48 2.50 2.51 2.55 2.56 2.57 2.58 2.59 2.60 2.61 2.62 2.63 2.64 2.65 trunk 0.10 0.11 0.12 0.20 0.21 0.30
wp-external-links / includes / class-wpel-register-scripts.php
wp-external-links / includes Last commit date
admin 5 years ago register-hooks 7 years ago class-wpel-front-ignore.php 7 years ago class-wpel-front.php 5 years ago class-wpel-link.php 7 years ago class-wpel-linkhero.php 5 years ago class-wpel-plugin.php 5 years ago class-wpel-register-scripts.php 5 years ago class-wpel-template-tags.php 7 years ago class-wpel-update.php 5 years ago index.php 6 years ago
class-wpel-register-scripts.php
100 lines
1 <?php
2
3 /**
4 * Class WPEL_Register_Scripts
5 *
6 * @package WPEL
7 * @category WordPress Plugin
8 * @version 2.3
9 * @link https://www.webfactoryltd.com/
10 * @license Dual licensed under the MIT and GPLv2+ licenses
11 */
12 final class WPEL_Register_Scripts extends WPRun_Base_1x0x0
13 {
14
15 /**
16 * Action for "wp_enqueue_scripts"
17 */
18 protected function action_wp_enqueue_scripts()
19 {
20 $this->register_scripts();
21 }
22
23 /**
24 * Action for "admin_enqueue_scripts"
25 */
26 protected function action_admin_enqueue_scripts()
27 {
28 $this->register_scripts();
29 }
30
31 /**
32 * Register styles and scripts
33 */
34 protected function register_scripts()
35 {
36 $plugin_version = get_option('wpel-version');
37
38 // set style font awesome icons
39 wp_register_style(
40 'font-awesome',
41 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css',
42 array(),
43 $plugin_version
44 );
45
46 // front style
47 wp_register_style(
48 'wpel-style',
49 plugins_url('/public/css/wpel.css', WPEL_Plugin::get_plugin_file()),
50 array(),
51 $plugin_version
52 );
53
54 // set admin style
55 wp_register_style(
56 'wpel-admin-style',
57 plugins_url('/public/css/wpel-admin.css', WPEL_Plugin::get_plugin_file()),
58 array(),
59 $plugin_version
60 );
61
62 // set admin global style
63 wp_register_style(
64 'wpel-admin-global-style',
65 plugins_url('/public/css/wpel-admin-global.css', WPEL_Plugin::get_plugin_file()),
66 array(),
67 $plugin_version
68 );
69
70 $linkhero = get_option('wpel-linkhero', array('checker' => array(), 'enabled' => false));
71 if(!isset($linkhero['enabled'])){
72 $linkhero['enabled'] = false;
73 }
74 $wpel_js = array(
75 'nonce_ajax' => wp_create_nonce('wpel_run_tool'),
76 'loader' => admin_url('/images/spinner.gif'),
77 'link_checking_enabled' => false
78 );
79
80 $wpel_js['lh_url'] = WPEL_LinkHero::$lh_url;
81
82 if(!WPEL_LinkHero::is_localhost()){
83 $wpel_js['link_checking_enabled'] = $linkhero['enabled'];
84 }
85
86 // set wpel admin script
87 wp_register_script(
88 'wpel-admin-script',
89 plugins_url('/public/js/wpel-admin.js', WPEL_Plugin::get_plugin_file()),
90 array('jquery'),
91 $plugin_version,
92 true
93 );
94
95 wp_localize_script('wpel-admin-script', 'wpel', $wpel_js);
96 }
97 }
98
99 /*?>*/
100