1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
<?php
namespace Objectiv\Plugins\Checkout\Compatibility\Themes;
use Objectiv\Plugins\Checkout\Compatibility\CompatibilityAbstract;
class Porto extends CompatibilityAbstract { public function is_available(): bool { return function_exists( 'porto_setup' ); }
/** * Add WP theme styles to list of blocked style handles. * * @param array $scripts * * @return array */ function remove_scripts( array $scripts ): array { global $wp_scripts;
foreach ( $wp_scripts->registered as $wp_script ) { if ( ! empty( $wp_script->src ) && ( stripos( $wp_script->src, '/themes/' ) !== false || stripos( $wp_script->src, '/porto_styles/' ) !== false ) && stripos( $wp_script->src, '/checkout-wc/' ) === false ) { $scripts[] = $wp_script->handle; } }
return $scripts; }
/** * Add WP theme styles to list of blocked style handles. * * @param array $styles * * @return array */ public function remove_styles( array $styles ): array { global $wp_styles;
foreach ( $wp_styles->registered as $wp_style ) { if ( ! empty( $wp_style->src ) && stripos( $wp_style->src, '/porto_styles/' ) !== false && stripos( $wp_style->src, '/checkout-wc/' ) === false ) { $styles[] = $wp_style->handle; } }
return $styles; } }
|