PluginProbe ʕ •ᴥ•ʔ
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress / 3.2.10
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress v3.2.10
4.16.18 4.16.17 4.16.16 trunk 1.0 1.0.1 1.0.2 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5a 1.1.6 1.1.7 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.4 1.4.1 1.4.2 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.7 1.7.1 1.7.2 1.8 1.8.1 1.8.10 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.1.9 2.2.10 2.2.11 2.2.12 2.2.13 2.2.14 2.2.15 2.2.16 2.2.2 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 3.0 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 4.0.0 4.0.1 4.0.2 4.0.3 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.10.0 4.10.1 4.10.2 4.10.3 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.13.3 4.13.4 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.15.0 4.15.1 4.15.10 4.15.11 4.15.12 4.15.13 4.15.14 4.15.15 4.15.16 4.15.17 4.15.18 4.15.19 4.15.2 4.15.20 4.15.20.1 4.15.21 4.15.22 4.15.23 4.15.24 4.15.25 4.15.3 4.15.4 4.15.5 4.15.6 4.15.7 4.15.8 4.15.9 4.16.0 4.16.1 4.16.10 4.16.11 4.16.12 4.16.13 4.16.14 4.16.15 4.16.2 4.16.3 4.16.4 4.16.5 4.16.6 4.16.7 4.16.8 4.16.9 4.2.0 4.3.0 4.3.1 4.3.2 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.7.0 4.8.0 4.9.0
wp-user-avatar / src / RegisterScripts.php
wp-user-avatar / src Last commit date
Admin 4 years ago AdminBarDashboardAccess 4 years ago Classes 4 years ago ContentProtection 4 years ago Functions 4 years ago NavigationMenuLinks 4 years ago RegisterActivation 4 years ago ShortcodeParser 4 years ago Themes 4 years ago Widgets 4 years ago lib 4 years ago Base.php 4 years ago DBUpdates.php 5 years ago RegisterScripts.php 4 years ago
RegisterScripts.php
153 lines
1 <?php
2
3 namespace ProfilePress\Core;
4
5 class RegisterScripts
6 {
7 public function __construct()
8 {
9 add_action('wp_enqueue_scripts', [$this, 'public_css']);
10 add_action('admin_enqueue_scripts', [$this, 'admin_css']);
11 add_action('wp_enqueue_scripts', [$this, 'public_js']);
12 add_action('admin_enqueue_scripts', [$this, 'admin_js'], 999999);
13 }
14
15 public function asset_suffix()
16 {
17 return (defined('W3GUY_LOCAL') && W3GUY_LOCAL) || (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
18 }
19
20 function admin_css()
21 {
22 wp_enqueue_style('ppress-select2', PPRESS_ASSETS_URL . '/select2/select2.min.css');
23 wp_enqueue_style('ppress-flatpickr', PPRESS_ASSETS_URL . '/flatpickr/flatpickr.min.css', false, PPRESS_VERSION_NUMBER);
24
25 wp_enqueue_style('wp-color-picker');
26
27 wp_enqueue_style('ppress-admin', PPRESS_ASSETS_URL . '/css/admin-style.css');
28
29 // only load in profilepress settings pages.
30 if ( ! ppress_is_admin_page()) return;
31
32 wp_enqueue_style('ppress-hint-tooltip', PPRESS_ASSETS_URL . "/css/hint.min.css", false, PPRESS_VERSION_NUMBER);
33
34 wp_enqueue_style('ppress-form-builder-styles', PPRESS_ASSETS_URL . '/css/form-builder.css');
35
36 wp_enqueue_style('ppress-codemirror', PPRESS_ASSETS_URL . '/codemirror/codemirror.css');
37
38 wp_enqueue_style('ppress-jbox', PPRESS_ASSETS_URL . '/jbox/jBox.all.min.css');
39 }
40
41 function public_css()
42 {
43 $suffix = $this->asset_suffix();
44 wp_enqueue_style('ppress-frontend', PPRESS_ASSETS_URL . "/css/frontend{$suffix}.css", false, PPRESS_VERSION_NUMBER);
45 wp_enqueue_style('ppress-flatpickr', PPRESS_ASSETS_URL . '/flatpickr/flatpickr.min.css', false, PPRESS_VERSION_NUMBER);
46 wp_enqueue_style('ppress-select2', PPRESS_ASSETS_URL . '/select2/select2.min.css');
47 }
48
49 function public_js()
50 {
51 $suffix = $this->asset_suffix();
52
53 $is_ajax_mode_disabled = ppress_get_setting('disable_ajax_mode') == 'yes' ? 'true' : 'false';
54
55 wp_enqueue_script('jquery');
56
57 if (isset($_GET['pp_preview_form']) ||
58 ppress_shortcode_exist_in_post('profilepress-registration') ||
59 ppress_shortcode_exist_in_post('profilepress-password-reset') ||
60 ppress_shortcode_exist_in_post('profilepress-edit-profile') ||
61 ppress_shortcode_exist_in_post('profilepress-my-account')
62 ) {
63 wp_enqueue_script('password-strength-meter');
64 }
65
66 wp_enqueue_script('ppress-flatpickr', PPRESS_ASSETS_URL . '/flatpickr/flatpickr.min.js', array('jquery'));
67
68 wp_enqueue_script('ppress-select2', PPRESS_ASSETS_URL . '/select2/select2.min.js', array('jquery'));
69
70 wp_enqueue_script('ppress-frontend-script', PPRESS_ASSETS_URL . "/js/frontend{$suffix}.js", ['jquery', 'ppress-flatpickr', 'ppress-select2'], PPRESS_VERSION_NUMBER, true);
71 wp_localize_script('ppress-frontend-script', 'pp_ajax_form', [
72 'ajaxurl' => admin_url('admin-ajax.php'),
73 'confirm_delete' => esc_html__('Are you sure?', 'wp-user-avatar'),
74 'deleting_text' => esc_html__('Deleting...', 'wp-user-avatar'),
75 'deleting_error' => esc_html__('An error occurred. Please try again.', 'wp-user-avatar'),
76 'nonce' => wp_create_nonce('ppress-frontend-nonce'),
77 'disable_ajax_form' => apply_filters('ppress_disable_ajax_form', (string)$is_ajax_mode_disabled)
78 ]);
79
80 if (isset($_GET['pp_preview_form']) || ppress_shortcode_exist_in_post('profilepress-member-directory')) {
81 wp_enqueue_script('ppress-member-directory', PPRESS_ASSETS_URL . "/js/member-directory{$suffix}.js", ['jquery', 'jquery-masonry', 'ppress-select2', 'ppress-flatpickr'], PPRESS_VERSION_NUMBER, true);
82 }
83
84 do_action('ppress_enqueue_public_js');
85 }
86
87 function admin_js()
88 {
89 global $pagenow;
90
91 wp_enqueue_script('jquery');
92 wp_enqueue_script('backbone');
93 wp_enqueue_script('underscore');
94 wp_enqueue_script('jquery-ui-core');
95 wp_enqueue_script('jquery-ui-sortable');
96 wp_enqueue_script('jquery-ui-draggable');
97
98 wp_enqueue_script('ppress-flatpickr', PPRESS_ASSETS_URL . '/flatpickr/flatpickr.min.js', array('jquery'));
99
100 if (in_array($pagenow, ['user-edit.php', 'profile.php']) || ppress_is_admin_page()) {
101 wp_enqueue_script('ppress-select2', PPRESS_ASSETS_URL . '/select2/select2.min.js', array('jquery'));
102 }
103
104 if ( ! ppress_is_admin_page()) return;
105
106 wp_enqueue_media();
107
108 wp_enqueue_script('ppress-jbox', PPRESS_ASSETS_URL . '/jbox/jBox.all.min.js', array('jquery'));
109 wp_enqueue_script('ppress-jbox-init', PPRESS_ASSETS_URL . '/jbox/init.js', array('ppress-jbox'));
110
111 wp_enqueue_script('ppress-clipboardjs', PPRESS_ASSETS_URL . '/js/clipboard.min.js');
112
113 wp_enqueue_script('ppress-admin-scripts', PPRESS_ASSETS_URL . '/js/admin.js', array('jquery', 'jquery-ui-sortable'));
114
115 wp_localize_script('ppress-admin-scripts', 'ppress_admin_globals', [
116 'nonce' => wp_create_nonce('ppress-admin-nonce')
117 ]);
118
119 wp_enqueue_script('ppress-create-form', PPRESS_ASSETS_URL . '/js/create-form.js', array('jquery'));
120 wp_enqueue_script('ppress-content-control', PPRESS_ASSETS_URL . '/js/content-control.js', array('jquery'));
121 wp_enqueue_script(
122 'ppress-form-builder',
123 PPRESS_ASSETS_URL . '/js/builder/app.min.js',
124 ['jquery', 'backbone', 'wp-util', 'jquery-ui-draggable', 'jquery-ui-core', 'jquery-ui-sortable', 'wp-color-picker']
125 );
126
127 wp_localize_script('ppress-form-builder', 'pp_form_builder', [
128 'confirm_delete' => esc_html__('Are you sure?', 'wp-user-avatar')
129 ]);
130
131 wp_enqueue_script('ppress-jquery-blockui', PPRESS_ASSETS_URL . '/js/jquery.blockUI.js', array('jquery'));
132
133 wp_enqueue_script('ppress-codemirror', PPRESS_ASSETS_URL . '/codemirror/codemirror.js');
134 wp_enqueue_script('ppress-codemirror-css', PPRESS_ASSETS_URL . '/codemirror/css.js', ['ppress-codemirror']);
135 wp_enqueue_script('ppress-codemirror-javascript', PPRESS_ASSETS_URL . '/codemirror/javascript.js', ['ppress-codemirror']);
136 wp_enqueue_script('ppress-codemirror-xml', PPRESS_ASSETS_URL . '/codemirror/xml.js', ['ppress-codemirror']);
137 wp_enqueue_script('ppress-codemirror-htmlmixed', PPRESS_ASSETS_URL . '/codemirror/htmlmixed.js', ['ppress-codemirror']);
138 }
139
140 /**
141 * @return RegisterScripts
142 */
143 public static function get_instance()
144 {
145 static $instance = null;
146
147 if (is_null($instance)) {
148 $instance = new self();
149 }
150
151 return $instance;
152 }
153 }