PluginProbe
Wp Social Login and Register Social Counter / 1.7.2
Wp Social Login and Register Social Counter v1.7.2
3.2.1 trunk 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.10 1.3.11 1.3.2 1.3.3 1.3.4 1.3.6 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.4 1.4.5 1.4.6 1.4.8 1.4.9 All 70 releases
wp-social / plugin.php

plugin.php in Wp Social Login and Register Social Counter 1.7.2, at plugin.php

90 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WP_Social;
4
5 defined('ABSPATH') || exit;
6
7 class Plugin {
8
9 private static $instance;
10
11
12 public static function instance() {
13 if(!self::$instance) {
14 self::$instance = new static();
15 }
16
17 return self::$instance;
18 }
19
20 public function __construct() {
21
22 }
23
24 public function enqueue() {
25
26 add_action( 'admin_enqueue_scripts', [$this, 'load_admin_scripts'] );
27
28 add_action( 'wp_enqueue_scripts', [$this, 'load_public_scripts'] );
29 }
30
31
32 public function load_admin_scripts() {
33 wp_enqueue_style( 'wps-wp-dashboard', WSLU_LOGIN_PLUGIN_URL . 'assets/css/wps-wp-dashboard.css', [], WSLU_VERSION );
34
35 wp_register_script( 'wslu_admin', WSLU_LOGIN_PLUGIN_URL. 'assets/js/admin-main.js', array('jquery', 'jquery-ui-sortable'));
36 wp_register_script( 'xs_login_custom_js1', WSLU_LOGIN_PLUGIN_URL. 'assets/js/admin-login-custom.js', array('jquery'));
37 wp_register_script( 'wp_social_select2_js', WSLU_LOGIN_PLUGIN_URL. 'assets/select2/script/select2-min.js', array('jquery'));
38 wp_register_script( 'wp_social_sortable_js', WSLU_LOGIN_PLUGIN_URL. 'assets/js/sortable.min.js', array('jquery'));
39
40
41 wp_localize_script('xs_login_custom_js1', 'rest_api_conf', array(
42 'siteurl' => get_option('siteurl'),
43 'nonce' => wp_create_nonce('wp_rest'),
44 'root' => get_rest_url(),
45 ));
46
47 wp_localize_script('wslu_admin', 'wsluAdminObj', [
48 'resturl' => get_rest_url(),
49 'rest_nonce' => wp_create_nonce('wp_rest'),
50 ]);
51
52 wp_enqueue_script( 'xs_login_custom_js1' );
53 wp_enqueue_script( 'wp_social_select2_js' );
54 wp_enqueue_script( 'wp_social_sortable_js' );
55 wp_enqueue_script( 'wslu_admin' );
56
57
58 wp_register_style( 'xs_login_custom_css1', WSLU_LOGIN_PLUGIN_URL. 'assets/css/admin-login-custom.css');
59 wp_register_style( 'wp_social_select2_css', WSLU_LOGIN_PLUGIN_URL. 'assets/select2/css/select2-min.css');
60 wp_register_style( 'xs_login_custom_css_icon', WSLU_LOGIN_PLUGIN_URL. 'assets/css/font-icon.css');
61 wp_register_style( 'xs_login_custom_css2', WSLU_LOGIN_PLUGIN_URL. 'assets/css/admin-style.css');
62 wp_register_style( 'xs_login_custom_css3', WSLU_LOGIN_PLUGIN_URL. 'assets/css/admin-responsive.css');
63
64 wp_enqueue_style( 'xs_login_custom_css1' );
65 wp_enqueue_style( 'wp_social_select2_css' );
66 wp_enqueue_style( 'xs_login_custom_css2' );
67 wp_enqueue_style( 'xs_login_custom_css3' );
68 wp_enqueue_style( 'xs_login_custom_css_icon' );
69 }
70
71
72 public function load_public_scripts() {
73
74 wp_register_script( 'xs_social_custom', WSLU_LOGIN_PLUGIN_URL. 'assets/js/social-front.js', array('jquery'));
75
76 wp_localize_script('xs_social_custom', 'rest_api_conf', array(
77 'siteurl' => get_option('siteurl'),
78 'nonce' => wp_create_nonce('wp_rest'),
79 'root' => get_rest_url(),
80 ));
81
82 wp_localize_script('xs_social_custom', 'wsluFrontObj', [
83 'resturl' => get_rest_url(),
84 'rest_nonce' => wp_create_nonce('wp_rest'),
85 ]);
86
87 wp_enqueue_script( 'xs_social_custom' );
88 }
89 }
90