PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.15.2
GiveWP – Donation Plugin and Fundraising Platform v4.15.2
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / FormBuilder / Actions / DequeueAdminStylesInFormBuilder.php
DequeueAdminStylesInFormBuilder.php
47 lines 1008 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\FormBuilder\Actions;
4
5 use Give\FormBuilder\FormBuilderRouteBuilder;
6
7 /**
8 * Since our form builder exists inside a WP admin page, it comes with a lot of baggage that we don't need.
9 * This removes the unnecessary styles before the page is loaded.
10 *
11 * @since 3.0.0
12 */
13 class DequeueAdminStylesInFormBuilder
14 {
15 /**
16 * @since 3.0.0
17 *
18 * @return void
19 */
20 public function __invoke()
21 {
22 if ($this->isFormBuilderRoute()) {
23 $wpStyles = wp_styles();
24
25 $legacyGiveStyles = [
26 'give-styles',
27 'give-admin-global-styles',
28 'give-admin-styles',
29 'give-admin-bar-notification',
30 'give-stripe-admin-css'
31 ];
32
33 $wpStyles->dequeue($legacyGiveStyles);
34 }
35 }
36
37 /**
38 * @since 3.0.0
39 *
40 * @return bool
41 */
42 protected function isFormBuilderRoute(): bool
43 {
44 return FormBuilderRouteBuilder::isRoute();
45 }
46 }
47