PluginProbe ʕ •ᴥ•ʔ
External Links – nofollow, noopener & new window / 2.66
External Links – nofollow, noopener & new window v2.66
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 2 months ago register-hooks 3 years ago class-wpel-front-ignore.php 3 years ago class-wpel-front.php 4 months ago class-wpel-link.php 3 years ago class-wpel-plugin.php 1 year ago class-wpel-register-scripts.php 2 months ago class-wpel-template-tags.php 3 years ago class-wpel-update.php 3 years ago index.php 6 years ago
class-wpel-register-scripts.php
98 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 $pointers = get_option('wpel-pointers', array());
38
39 if(function_exists('get_current_screen')){
40 $current_screen = get_current_screen();
41 }
42
43 if (isset($current_screen) && $current_screen->id != 'toplevel_page_wpel-settings-page' && $current_screen->id != 'settings_page_wpel-settings-page') {
44 if (empty($pointers['hide_welcome_pointer']) && current_user_can('administrator')) {
45 $pointers['_nonce_dismiss_pointer'] = wp_create_nonce('wpel_dismiss_notice');
46 $pointers['welcome'] = array('target' => '#toplevel_page_wpel-settings-page', 'edge' => 'left', 'align' => 'right', 'content' => 'Thank you for installing the <b style="font-weight: 800;">WP External Links</b> plugin!<br>Open <a href="' . admin_url('admin.php?page=wpel-settings-page') . '">WP External Links</a> to manage your links, and configure settings.');
47
48 wp_enqueue_style('wp-pointer');
49
50 wp_enqueue_script('wpel-pointers', plugins_url('/public/js/wpel-pointers.js', WPEL_Plugin::get_plugin_file()), array('jquery'), get_option('wpel-version'), true);
51 wp_enqueue_script('wp-pointer');
52 wp_localize_script('wp-pointer', 'wpel_pointers', $pointers);
53 }
54 }
55
56 // set style font awesome icons
57 wp_register_style(
58 'wpel-font-awesome',
59 plugins_url('/public/css/font-awesome.min.css', WPEL_Plugin::get_plugin_file()),
60 array(),
61 $plugin_version
62 );
63
64 // front style
65 wp_register_style(
66 'wpel-style',
67 plugins_url('/public/css/wpel.css', WPEL_Plugin::get_plugin_file()),
68 array(),
69 $plugin_version
70 );
71
72 // set admin style
73 wp_register_style(
74 'wpel-admin-style',
75 plugins_url('/public/css/wpel-admin.css', WPEL_Plugin::get_plugin_file()),
76 array(),
77 $plugin_version
78 );
79
80 $wpel_js = array(
81 'nonce_ajax' => wp_create_nonce('wpel_run_tool'),
82 'wpcaptcha_install_url' => add_query_arg(array('action' => 'wpel_install_wpcaptcha', '_wpnonce' => wp_create_nonce('install_wpcaptcha'), 'rnd' => wp_rand()), admin_url('admin.php')),
83 'loader' => admin_url('/images/spinner.gif')
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