PluginProbe
Easy Invoice – Invoice Generator, PDF Quotes & Payments / 2.4.1
Easy Invoice – Invoice Generator, PDF Quotes & Payments v2.4.1
2.4.0 2.4.1 2.3.8 2.3.7 2.3.6 2.3.5 2.3.4 2.3.3 2.3.2 2.3.1 2.2.0 2.1.21 2.1.20 2.1.19 2.1.18 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.2 All 57 releases
easy-invoice / includes / Helpers / EnqueueHelper.php

EnqueueHelper.php in Easy Invoice – Invoice Generator, PDF Quotes & Payments 2.4.1, at includes/Helpers/EnqueueHelper.php

50 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Enqueue Easy Invoice form styles
4 */
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit;
7 }
8 function easy_invoice_enqueue_form_styles() {
9 // Only on Easy Invoice admin pages
10 $page = isset($_GET['page']) ? sanitize_key(wp_unslash($_GET['page'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
11 if (!empty($page) && (
12 strpos($page, 'easy-invoice') === 0 ||
13 strpos($page, 'easy-quote') === 0 ||
14 strpos($page, 'easy-invoice-builder') === 0 ||
15 strpos($page, 'easy-invoice-quote-builder') === 0
16 )) {
17 // Form styling is handled by Tailwind CSS classes
18 // No separate form.css needed
19 }
20 }
21 add_action('admin_enqueue_scripts', 'easy_invoice_enqueue_form_styles');
22
23 /**
24 * Dequeue WordPress default form CSS for Easy Invoice plugin
25 */
26 function easy_invoice_dequeue_form_styles() {
27 // Only on Easy Invoice admin pages
28 $page = isset($_GET['page']) ? sanitize_key(wp_unslash($_GET['page'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
29 if (!empty($page) && (
30 strpos($page, 'easy-invoice') === 0 ||
31 strpos($page, 'easy-quote') === 0 ||
32 strpos($page, 'easy-invoice-builder') === 0 ||
33 strpos($page, 'easy-invoice-quote-builder') === 0
34 )) {
35 // Only remove form-related WordPress default styles
36 wp_deregister_style('colors');
37 wp_dequeue_style('colors');
38
39
40 wp_deregister_style('wp-admin');
41 wp_dequeue_style('wp-admin');
42
43
44 wp_deregister_style('forms');
45 wp_dequeue_style('forms');
46 }
47 }
48 add_action('wp_print_styles', 'easy_invoice_dequeue_form_styles', 999);
49 add_action('admin_enqueue_scripts', 'easy_invoice_dequeue_form_styles', 1);
50