PluginProbe ʕ •ᴥ•ʔ
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor / 4.0.1
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor v4.0.1
4.0.2 4.0.1 4.0.0 3.10.02 3.10.01 3.9.10 3.9.9 3.9.8 3.9.7 3.9.5 3.9.6 3.9.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.3.1 2.3.1.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.4.0 2.5.0 2.5.1 2.5.10 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.2 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.6.0 3.6.1 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.8.1 3.8.2 3.9.0 3.9.1 3.9.2 trunk 1.2.6 1.2.7 1.2.9 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.11 1.5.12 1.5.2 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.0.9.1 2.0.9.2 2.0.9.3
elementskit-lite / libs / framework / attr.php
elementskit-lite / libs / framework Last commit date
assets 3 weeks ago classes 3 weeks ago controls 6 months ago views 3 weeks ago attr.php 3 weeks ago
attr.php
147 lines
1 <?php
2 namespace ElementsKit_Lite\Libs\Framework;
3
4 use ElementsKit_Lite\Libs\Framework\Classes\Utils;
5
6 defined( 'ABSPATH' ) || exit;
7
8 class Attr {
9
10 use \ElementsKit_Lite\Traits\Singleton;
11
12 public $utils;
13
14 public static function get_dir() {
15 return \ElementsKit_Lite::lib_dir() . 'framework/';
16 }
17
18 public static function get_url() {
19 return \ElementsKit_Lite::lib_url() . 'framework/';
20 }
21
22 public static function key() {
23 return 'elementskit';
24 }
25
26 public function __construct() {
27 $this->utils = Classes\Utils::instance();
28 new Classes\Ajax();
29
30 // register admin menus
31 add_action( 'admin_menu', array( $this, 'register_settings_menus' ) );
32 // add_action('admin_menu', [$this, 'register_support_menu'], 999);
33
34 // register js/ css
35 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
36
37 // whitelist styles
38 add_filter( 'mailpoet_conflict_resolver_whitelist_style', array( $this, 'whitelisted_styles' ) );
39
40 add_action( 'elementskit-lite/pro_awareness/before_grid_contents', array( $this, 'user_consent_for_banner' ) );
41 }
42
43 public function whitelisted_styles( $styles ) {
44 $styles[] = 'admin-global.css';
45 return $styles;
46 }
47
48 public function include_files() {
49 }
50
51 public function enqueue_scripts() {
52 wp_register_style( 'elementskit-admin-global', \ElementsKit_Lite::lib_url() . 'framework/assets/css/admin-global.css', false, \ElementsKit_Lite::version() );
53 wp_enqueue_style( 'elementskit-admin-global' );
54 add_filter('admin_footer_text', [$this, 'elementskit_admin_footer_text']);
55 }
56
57 public function register_settings_menus() {
58
59 // dashboard, main menu
60 add_menu_page(
61 esc_html__( 'ElementsKit Settings', 'elementskit-lite' ),
62 'ElementsKit', // esc_html__( 'ElementsKit', 'elementskit-lite' ),
63 'manage_options',
64 self::key(),
65 array( $this, 'register_settings_contents__settings' ),
66 self::get_url() . 'assets/images/ekit_icon.svg',
67 '58.6'
68 );
69 }
70
71 public function elementskit_admin_footer_text($text) {
72 // Only show on ElementsKit admin pages
73 if ( ! $this->is_elementskit_page() ) {
74 return $text;
75 }
76
77 $plugin_name = '<strong>' . esc_html__( 'ElementsKit', 'elementskit-lite' ) . '</strong>';
78 $review_url = esc_url( 'https://wordpress.org/support/plugin/elementskit-lite/reviews/');
79
80 $text = sprintf(
81 '<span class="elementskit-footer-text"><i>%1$s</i></span>',
82 sprintf(
83 /* translators: 1: Plugin name, 2: Review URL */
84 __( 'Enjoying %1$s? Please consider leaving us a <a href="%2$s" target="_blank" rel="noopener noreferrer">�
85
86
87
88
89 </a> review. Your support means a lot to our team!', 'elementskit-lite' ),
90 $plugin_name,
91 $review_url
92 )
93 );
94 return $text;
95 }
96
97 /**
98 * Check if current page is an ElementsKit admin page
99 *
100 * @return bool
101 */
102 private function is_elementskit_page() {
103 $current_screen = get_current_screen();
104
105 if ( ! $current_screen ) {
106 return false;
107 }
108
109 // List of allowed pages (from ?page parameter)
110 $allowed_pages = array(
111 'elementskit',
112 'elementskit-license',
113 'forms',
114 'elementskit-lite_wpmet_plugins',
115 'elementskit-lite_get_help',
116 );
117
118 // List of allowed post types (from ?post_type parameter)
119 $allowed_post_types = array(
120 'elementskit_template',
121 'elementskit_widget',
122 );
123
124 // Check by post_type (for custom post type listings)
125 if ( ! empty( $current_screen->post_type ) && in_array( $current_screen->post_type, $allowed_post_types, true ) ) {
126 return true;
127 }
128
129 // Check by page parameter (for admin pages)
130 $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '';
131 if ( $page && in_array( $page, $allowed_pages, true ) ) {
132 return true;
133 }
134
135 return false;
136 }
137
138 public function register_settings_contents__settings() {
139 include self::get_dir() . 'views/init.php';
140 }
141
142 public function user_consent_for_banner() {
143 include self::get_dir() . 'views/layout-user-consent-for-banner.php';
144 }
145
146 }
147