File tree Expand file tree Collapse file tree 5 files changed +20
-0
lines changed
Expand file tree Collapse file tree 5 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1010
1111interface AssetInterface
1212{
13+ public function shouldEnqueue (): bool ;
1314 public function getHook (): string ;
1415 public function getHandle (): string ;
1516 public function getFilename (): string ;
Original file line number Diff line number Diff line change @@ -104,6 +104,10 @@ public function register(): void
104104
105105 public function enqueue (): void
106106 {
107+ if ($ this ->isEnabled () === false ) {
108+ return ;
109+ }
110+
107111 $ filename = $ this ->getFilename ();
108112
109113 if ($ this ->getType ($ filename ) === 'css ' ) {
Original file line number Diff line number Diff line change 66
77class ContextDetection extends AssetRegistry implements AssetInterface
88{
9+ public function shouldEnqueue (): bool
10+ {
11+ return $ this ->config ->isContextCheckEnabled ();
12+ }
13+
914 public function getHook (): string
1015 {
1116 return 'wp_enqueue_scripts ' ;
Original file line number Diff line number Diff line change 66
77class EditorHighlight extends AssetRegistry implements AssetInterface
88{
9+ public function shouldEnqueue (): bool
10+ {
11+ return true ;
12+ }
13+
914 public function getHook (): string
1015 {
1116 return 'mce_external_plugins ' ;
Original file line number Diff line number Diff line change 66
77class FrontendStyles extends AssetRegistry implements AssetInterface
88{
9+ public function shouldEnqueue (): bool
10+ {
11+ return true ;
12+ }
13+
914 public function getHook (): string
1015 {
1116 return 'wp_enqueue_scripts ' ;
You can’t perform that action at this time.
0 commit comments